Mercurial > hg > CbC > old > device
view test/bitfield.c @ 874:3454953b3df0
fix inline strinit not yet worked.
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 01 Apr 2014 23:25:05 +0900 |
parents | 9598ecec0af5 |
children | 5313ed059cee |
line wrap: on
line source
int printf(const char *format, ...); typedef unsigned long long ULL; typedef union { struct _PTE { unsigned long v:1; unsigned long vsid:24; unsigned long h:1; unsigned long api:6; unsigned long rpn:20; unsigned long :3; unsigned long r:1; unsigned long c:1; unsigned long w:1; unsigned long i:1; unsigned long m:1; unsigned long g:1; unsigned long :1; unsigned long pp:2; long long lpn:40; } pte; struct { char v:1; signed long vsid:24; unsigned long h:1; signed char api:6; signed long rpn:20; signed long :3; unsigned long r:1; unsigned long c:1; unsigned long w:1; unsigned long i:1; unsigned long m:1; unsigned long g:1; unsigned long :1; signed long pp:2; } sg; unsigned long u[2]; } PTE; PTE g; static void main2(); static void main5(); static void main5c(); static int main3(); static int main4(); static void main6(); static void main7(); int main() { PTE a,*p; int i = 0; int j = 0; a.pte.rpn = 55; j = a.pte.rpn; printf("#0061:% 3d: %d\n",i++,j); a.pte.c = 1; j = a.pte.c; printf("#0064:% 3d: %d\n",i++,j); a.pte.pp = -1; j = a.pte.pp; printf("#0067:% 3d: %d\n",i++,j); a.sg.pp = -1; j = a.sg.pp; printf("#0070:% 3d: %d\n",i++,j); p = &g; g.u[0]=0; g.u[1]=0; printf("#0077:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.pte. v = 1; printf("#0079:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.pte. vsid = 0xffffff; printf("#0081:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.pte. h = 1; printf("#0083:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.pte. api = 3; printf("#0085:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.pte. rpn = 3; printf("#0087:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.pte. r = 1; printf("#0090:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.pte. c = 1; printf("#0092:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.pte. w = 1; printf("#0094:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.pte. i = 1; printf("#0096:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.pte. m = 1; printf("#0098:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.pte. g = 1; printf("#0100:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.pte. pp = 3; printf("#0102:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.u[0]=-1; g.u[1]=-1; printf("#0107:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.pte. v = 0; printf("#0109:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.pte. vsid = 0; printf("#0111:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.pte. h = 0; printf("#0113:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.pte. api = 0; printf("#0115:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.pte. rpn = 0; printf("#0117:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.pte. r = 0; printf("#0120:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.pte. c = 0; printf("#0122:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.pte. w = 0; printf("#0124:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.pte. i = 0; printf("#0126:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.pte. m = 0; printf("#0128:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.pte. g = 0; printf("#0130:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.pte. pp = 0; printf("#0132:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.u[0]=-1; g.u[1]=-1; printf("#0137:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.pte. v = 0; printf("#0139:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.pte. vsid = 0x555555; printf("#0141:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.pte. h = 0; printf("#0143:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.pte. api = 0x15; printf("#0145:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.pte. rpn = 0x55555; printf("#0147:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.pte. r = 1; printf("#0150:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.pte. c = 1; printf("#0152:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.pte. w = 1; printf("#0154:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.pte. i = 1; printf("#0156:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.pte. m = 1; printf("#0158:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.pte. g = 1; printf("#0160:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.pte. pp = 3; printf("#0162:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.u[0]=-1; g.u[1]=-1; for(i=0;i<0x200;i++) { printf("#0168:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.pte. v = i; printf("#0170:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.pte. vsid = i; printf("#0172:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.pte. h = i; printf("#0174:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.pte. api = i; printf("#0176:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.pte. rpn = i; printf("#0178:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.pte. r = i; printf("#0181:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.pte. c = i; printf("#0183:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.pte. w = i; printf("#0185:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.pte. i = i; printf("#0187:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.pte. m = i; printf("#0189:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.pte. g = i; printf("#0191:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.pte. pp = i; printf("#0193:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); } g = a; printf("#0198:%d %d %d\n",a.pte.pp,g.pte.pp,p->pte.pp); main2(); main5(); main5c(); main3(); main4(); main6(); main7(); return 0; } void main2() { int i = 0; g.u[0]=0; g.u[1]=0; printf("#0216:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.sg. v = 1; printf("#0218:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.sg. vsid = 0xffffff; printf("#0220:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.sg. h = 1; printf("#0222:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.sg. api = 1; printf("#0224:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.sg. rpn = 1; printf("#0226:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.sg. r = 1; printf("#0229:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.sg. c = 1; printf("#0231:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.sg. w = 1; printf("#0233:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.sg. i = 1; printf("#0235:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.sg. m = 1; printf("#0237:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.sg. g = 1; printf("#0239:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.sg. pp = 0x3; printf("#0241:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.u[0]=-1; g.u[1]=-1; printf("#0246:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.sg. v = 0; printf("#0248:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.sg. vsid = 0; printf("#0250:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.sg. h = 0; printf("#0252:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.sg. api = 0; printf("#0254:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.sg. rpn = 0; printf("#0256:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.sg. r = 0; printf("#0259:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.sg. c = 0; printf("#0261:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.sg. w = 0; printf("#0263:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.sg. i = 0; printf("#0265:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.sg. m = 0; printf("#0267:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.sg. g = 0; printf("#0269:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.sg. pp = 0; printf("#0271:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.u[0]=-1; g.u[1]=-1; printf("#0276:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.sg. v = 0; printf("#0278:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.sg. vsid = 0; printf("#0280:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.sg. h = 0; printf("#0282:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.sg. api = 0; printf("#0284:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.sg. rpn = 0; printf("#0286:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.sg. r = 0; printf("#0289:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.sg. c = 0; printf("#0291:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.sg. w = 0; printf("#0293:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.sg. i = 0; printf("#0295:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.sg. m = 0; printf("#0297:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.sg. g = 0; printf("#0299:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.sg. pp = 3; printf("#0301:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.u[0]=-1; g.u[1]=-1; for(i=-0x100;i<0x100;i++) { printf("#0307:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.sg. v = i; printf("#0309:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.sg. vsid = i; printf("#0311:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.sg. h = i; printf("#0313:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.sg. api = i; printf("#0315:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.sg. rpn = i; printf("#0317:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.sg. r = i; printf("#0320:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.sg. c = i; printf("#0322:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.sg. w = i; printf("#0324:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.sg. i = i; printf("#0326:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.sg. m = i; printf("#0328:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.sg. g = i; printf("#0330:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); g.sg. pp = i; printf("#0332:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); } // printf("#0335:size of %d\n",sizeof(g.sg.pp)); no size of for bit-field } // int :12 bit-field cannot be a return value; // main3( int a:8 ) bit-field cannot be an argument; int main3( int a ) { // int b:9; // nor local variable int b,i; i = 7; b = g.pte.rpn = -333; printf("#0350:main3-0: %d\n",b); b = g.pte.rpn--; printf("#0352:main3-1: %d\n",b); b = g.pte.rpn++; printf("#0354:main3-2: %d\n",b); b = --g.pte.rpn; printf("#0356:main3-3: %d\n",b); b = ++g.pte.rpn; printf("#0358:main3-4: %d\n",b); b = (g.pte.rpn += 3); printf("#0360:main3-5: %d\n",b); b = (g.pte.rpn -= 3); printf("#0362:main3-6: %d\n",b); b = (g.pte.rpn *= 3); printf("#0364:main3-7: %d\n",b); b = (g.pte.rpn /= 3); printf("#0366:main3-8: %d\n",b); b = (g.pte.rpn %= 3); printf("#0368:main3-9: %d\n",b); b = (g.pte.rpn |= 3); printf("#0370:main3-10: %d\n",b); b = (g.pte.rpn &= 3); printf("#0372:main3-12: %d\n",b); b = (g.pte.rpn ^= 3); printf("#0374:main3-13: %d\n",b); b = (g.pte.rpn <<= 3); printf("#0376:main3-14: %d\n",b); b = (g.pte.rpn >>= 3); printf("#0378:main3-15: %d\n",b); g.pte.rpn = -333; printf("#0381:main3-16: %d\n",b); b = g.pte.rpn--; printf("#0383:main3-17: %d\n",b); b = g.pte.rpn++; printf("#0385:main3-18: %d\n",b); b = --g.pte.rpn; printf("#0387:main3-19: %d\n",b); b = ++g.pte.rpn; printf("#0389:main3-20: %d\n",b); b = (g.pte.rpn += i); printf("#0391:main3-21: %d\n",b); b = (g.pte.rpn -= i); printf("#0393:main3-22: %d\n",b); b = (g.pte.rpn *= i); printf("#0395:main3-23: %d\n",b); b = (g.pte.rpn /= i); printf("#0397:main3-24: %d\n",b); b = (g.pte.rpn %= i); printf("#0399:main3-25: %d\n",b); b = (g.pte.rpn |= i); printf("#0401:main3-26: %d\n",b); b = (g.pte.rpn &= i); printf("#0403:main3-27: %d\n",b); b = (g.pte.rpn ^= i); printf("#0405:main3-28: %d\n",b); b = (g.pte.rpn <<= i); printf("#0407:main3-29: %d\n",b); b = (g.pte.rpn >>= i); printf("#0409:main3-30: %d\n",b); return --b; } int main4( int a ) { // int b:9; // nor local variable int b,i; PTE *pg = &g; i = 7; pg->pte.rpn = -333; printf("#0424:main4-0: %d\n",b); b = pg->pte.rpn--; printf("#0426:main4-1: %d\n",b); b = pg->pte.rpn++; printf("#0428:main4-2: %d\n",b); b = --pg->pte.rpn; printf("#0430:main4-3: %d\n",b); b = ++pg->pte.rpn; printf("#0432:main4-4: %d\n",b); b = (pg->pte.rpn += 3); printf("#0434:main4-5: %d\n",b); b = (pg->pte.rpn -= 3); printf("#0436:main4-6: %d\n",b); b = (pg->pte.rpn *= 3); printf("#0438:main4-7: %d\n",b); b = (pg->pte.rpn /= 3); printf("#0440:main4-8: %d\n",b); b = (pg->pte.rpn %= 3); printf("#0442:main4-9: %d\n",b); b = (pg->pte.rpn |= 3); printf("#0444:main4-10: %d\n",b); b = (pg->pte.rpn &= 3); printf("#0446:main4-12: %d\n",b); b = (pg->pte.rpn ^= 3); printf("#0448:main4-13: %d\n",b); b = (pg->pte.rpn <<= 3); printf("#0450:main4-14: %d\n",b); b = (pg->pte.rpn >>= 3); printf("#0452:main4-15: %d\n",b); pg->pte.rpn = -333; printf("#0455:main4-16: %d\n",b); b = pg->pte.rpn--; printf("#0457:main4-17: %d\n",b); b = pg->pte.rpn++; printf("#0459:main4-18: %d\n",b); b = --pg->pte.rpn; printf("#0461:main4-19: %d\n",b); b = ++pg->pte.rpn; printf("#0463:main4-20: %d\n",b); b = (pg->pte.rpn += i); printf("#0465:main4-21: %d\n",b); b = (pg->pte.rpn -= i); printf("#0467:main4-22: %d\n",b); b = (pg->pte.rpn *= i); printf("#0469:main4-23: %d\n",b); b = (pg->pte.rpn /= i); printf("#0471:main4-24: %d\n",b); b = (pg->pte.rpn %= i); printf("#0473:main4-25: %d\n",b); b = (pg->pte.rpn |= i); printf("#0475:main4-26: %d\n",b); b = (pg->pte.rpn &= i); printf("#0477:main4-27: %d\n",b); b = (pg->pte.rpn ^= i); printf("#0479:main4-28: %d\n",b); b = (pg->pte.rpn <<= i); printf("#0481:main4-29: %d\n",b); b = (pg->pte.rpn >>= i); printf("#0483:main4-30: %d\n",b); return --b; } union ll1 { int a[8]; struct { char a:4; unsigned long long v:33; unsigned long long w:33; unsigned long long x:33; } b; } ll1; union ll0 { int a[8]; struct { char a:4; unsigned long long v:48; unsigned long long w:48; unsigned long long x:48; } b; } ll0; union ll { int a[8]; struct { unsigned char a:4; unsigned long long v:56; unsigned long long w:56; unsigned long long x:56; } b; } ll; union cc { int a; struct { char a:1; char b:4; char c:7; char d:4; char e:4; char f:4; } b; } cc; union ii { int a; struct { int a:1; int b:4; int c:4; int d:4; int e:4; int f:4; } b; } ii; long long m1 = 0x123456789abcdefLL; int p1 = 1; int zero = 0; void main5c() { ii.b.a = -1; printf("#0555:m5c-00:%d\n",ii.b.a); ll1.b.v = 0x123456defLL; printf("#0558:m5c-01:%llx\n",(ULL)ll1.b.v); printf("#0559:m5c-02:%16x %16x %16x %16x %16x %16x %16x %16x\n", ll1.a[0],ll1.a[1],ll1.a[2],ll1.a[3], ll1.a[4],ll1.a[5],ll1.a[6],ll1.a[7] ); ll1.b.v = 0; printf("#0564:m5c-01:%llx\n", (ULL)(ll1.b.w = 0x123456defLL)); printf("#0566:m5c-02:%16x %16x %16x %16x %16x %16x %16x %16x\n", ll1.a[0],ll1.a[1],ll1.a[2],ll1.a[3], ll1.a[4],ll1.a[5],ll1.a[6],ll1.a[7] ); ll1.b.w = 0; printf("#0571:m5c-01:%llx\n", (ULL)(ll1.b.x = -0x12456defLL)); printf("#0573:m5c-02:%16x %16x %16x %16x %16x %16x %16x %16x\n", ll1.a[0],ll1.a[1],ll1.a[2],ll1.a[3], ll1.a[4],ll1.a[5],ll1.a[6],ll1.a[7] ); ll1.b.x = 0; printf("#0579:m5c-01:%llx\n", (ULL)(ll0.b.v = 0x123457cdefLL)); printf("#0581:m5c-01:%llx\n",(ULL)ll0.b.v); printf("#0582:m5c-02:%16x %16x %16x %16x %16x %16x %16x %16x\n", ll0.a[0],ll0.a[1],ll0.a[2],ll0.a[3], ll0.a[4],ll0.a[5],ll0.a[6],ll0.a[7] ); ll0.b.v = 0; printf("#0587:m5c-01:%llx\n", (ULL)(ll0.b.w = 0x1234abcdefLL)); printf("#0589:m5c-02:%16x %16x %16x %16x %16x %16x %16x %16x\n", ll0.a[0],ll0.a[1],ll0.a[2],ll0.a[3], ll0.a[4],ll0.a[5],ll0.a[6],ll0.a[7] ); ll0.b.w = 0; printf("#0594:m5c-01:%llx\n", (ULL)(ll0.b.x = 0x1234abcdefLL)); printf("#0596:m5c-02:%16x %16x %16x %16x %16x %16x %16x %16x\n", ll0.a[0],ll0.a[1],ll0.a[2],ll0.a[3], ll0.a[4],ll0.a[5],ll0.a[6],ll0.a[7] ); ll0.b.x = 0; printf("#0602:m5c-01:%llx\n", (ULL)(ll.b.v = 0x12389abcdefLL)); printf("#0604:m5c-1:%llx\n",(ULL)ll.b.v); printf("#0605:m5c-2:%16x %16x %16x %16x %16x %16x %16x %16x\n", ll.a[0],ll.a[1],ll.a[2],ll.a[3], ll.a[4],ll.a[5],ll.a[6],ll.a[7] ); ll.b.v = 0; printf("#0610:m5c-01:%llx\n", (ULL)(ll.b.w = 0x12389abcdefLL)); printf("#0612:m5c-2:%16x %16x %16x %16x %16x %16x %16x %16x\n", ll.a[0],ll.a[1],ll.a[2],ll.a[3], ll.a[4],ll.a[5],ll.a[6],ll.a[7] ); ll.b.w = 0; printf("#0617:m5c-01:%llx\n", (ULL)(ll.b.x = 0x12389abcdefLL)); printf("#0619:m5c-2:%16x %16x %16x %16x %16x %16x %16x %16x\n", ll.a[0],ll.a[1],ll.a[2],ll.a[3], ll.a[4],ll.a[5],ll.a[6],ll.a[7] ); ll.b.x = 0; printf("#0625:m5c-char a:1; char b:4; char c:7; char d:4; char e:4; char f:4;\n"); cc.a = 0; cc.b.a = -1; printf("#0628:m5c-a:%16x\n",cc.a); cc.b.b = -1; printf("#0630:m5c-b:%16x\n",cc.a); cc.b.c = -1; printf("#0632:m5c-c:%16x\n",cc.a); cc.b.d = -1; printf("#0634:m5c-d:%16x\n",cc.a); cc.b.e = -1; printf("#0636:m5c-e:%16x\n",cc.a); cc.b.f = -1; printf("#0638:m5c-f:%16x\n",cc.a); printf("#0639:m5c-3:%d %d\n",cc.b.c,cc.b.d); cc.a = -1; printf("#0641:m5c-f:%16x\n",cc.a); cc.b.a = 0; printf("#0643:m5c-a:%16x\n",cc.a); cc.b.b = 0; printf("#0645:m5c-b:%16x\n",cc.a); cc.b.c = 0; printf("#0647:m5c-c:%16x\n",cc.a); cc.b.d = 0; printf("#0649:m5c-d:%16x\n",cc.a); cc.b.e = 0; printf("#0651:m5c-e:%16x\n",cc.a); cc.b.f = 0; printf("#0653:m5c-f:%16x\n",cc.a); printf("#0654:m5c-3:%d %d\n",cc.b.c,cc.b.d); cc.a = 0; printf("#0656:m5c-f:%16x\n",cc.a); cc.b.a = 1; printf("#0658:m5c-a:%16x\n",cc.a); cc.b.b = 1; printf("#0660:m5c-b:%16x\n",cc.a); cc.b.c = 1; printf("#0662:m5c-c:%16x\n",cc.a); cc.b.d = 1; printf("#0664:m5c-d:%16x\n",cc.a); cc.b.e = 1; printf("#0666:m5c-e:%16x\n",cc.a); cc.b.f = 1; printf("#0668:m5c-f:%16x\n",cc.a); printf("#0669:m5c-3:%d %d\n",cc.b.c,cc.b.d); cc.a = -1; printf("#0671:m5c-f:%16x\n",cc.a); cc.b.a = 1; printf("#0673:m5c-a:%16x\n",cc.a); cc.b.b = 1; printf("#0675:m5c-b:%16x\n",cc.a); cc.b.c = 1; printf("#0677:m5c-c:%16x\n",cc.a); cc.b.d = 1; printf("#0679:m5c-d:%16x\n",cc.a); cc.b.e = 1; printf("#0681:m5c-e:%16x\n",cc.a); cc.b.f = 1; printf("#0683:m5c-f:%16x\n",cc.a); printf("#0684:m5c-3:%d %d\n",cc.b.c,cc.b.d); ii.b.a = -1; printf("#0687:m5c-6:%16x\n",ii.a); ii.b.d = -1; printf("#0689:m5c-6:%16x\n",ii.a); printf("#0690:m5c-5:%d %d\n",ii.b.a,ii.b.d); } void main5() { ii.b.a = -1; printf("#0697:00:%d\n",ii.b.a); ll1.b.v = m1; printf("#0700:01:%llx\n",(ULL)ll1.b.v); printf("#0701:02:%16x %16x %16x %16x %16x %16x %16x %16x\n", ll1.a[0],ll1.a[1],ll1.a[2],ll1.a[3], ll1.a[4],ll1.a[5],ll1.a[6],ll1.a[7] ); ll1.b.v = zero; ll1.b.w = m1; printf("#0707:02:%16x %16x %16x %16x %16x %16x %16x %16x\n", ll1.a[0],ll1.a[1],ll1.a[2],ll1.a[3], ll1.a[4],ll1.a[5],ll1.a[6],ll1.a[7] ); ll1.b.w = zero; ll1.b.x = m1; printf("#0713:02:%16x %16x %16x %16x %16x %16x %16x %16x\n", ll1.a[0],ll1.a[1],ll1.a[2],ll1.a[3], ll1.a[4],ll1.a[5],ll1.a[6],ll1.a[7] ); ll1.b.x = zero; ll0.b.v = m1; printf("#0720:01:%llx\n",(ULL)ll0.b.v); printf("#0721:02:%16x %16x %16x %16x %16x %16x %16x %16x\n", ll0.a[0],ll0.a[1],ll0.a[2],ll0.a[3], ll0.a[4],ll0.a[5],ll0.a[6],ll0.a[7] ); ll0.b.v = zero; ll0.b.w = m1; printf("#0727:02:%16x %16x %16x %16x %16x %16x %16x %16x\n", ll0.a[0],ll0.a[1],ll0.a[2],ll0.a[3], ll0.a[4],ll0.a[5],ll0.a[6],ll0.a[7] ); ll0.b.w = zero; ll0.b.x = m1; printf("#0733:02:%16x %16x %16x %16x %16x %16x %16x %16x\n", ll0.a[0],ll0.a[1],ll0.a[2],ll0.a[3], ll0.a[4],ll0.a[5],ll0.a[6],ll0.a[7] ); ll0.b.x = zero; ll.b.v = m1; printf("#0740:1:%llx\n",(ULL)ll.b.v); printf("#0741:2:%16x %16x %16x %16x %16x %16x %16x %16x\n", ll.a[0],ll.a[1],ll.a[2],ll.a[3], ll.a[4],ll.a[5],ll.a[6],ll.a[7] ); ll.b.v = zero; ll.b.w = m1; printf("#0747:2:%16x %16x %16x %16x %16x %16x %16x %16x\n", ll.a[0],ll.a[1],ll.a[2],ll.a[3], ll.a[4],ll.a[5],ll.a[6],ll.a[7] ); ll.b.w = zero; ll.b.x = m1; printf("#0753:2:%16x %16x %16x %16x %16x %16x %16x %16x\n", ll.a[0],ll.a[1],ll.a[2],ll.a[3], ll.a[4],ll.a[5],ll.a[6],ll.a[7] ); ll.b.x = zero; cc.a = zero; printf("#0760:char a:1; char b:4; char c:7; char d:4; char e:4; char f:4;\n"); cc.b.a = m1; printf("#0762:a:%16x\n",cc.a); cc.b.b = m1; printf("#0764:b:%16x\n",cc.a); cc.b.c = m1; printf("#0766:c:%16x\n",cc.a); cc.b.d = m1; printf("#0768:d:%16x\n",cc.a); cc.b.e = m1; printf("#0770:e:%16x\n",cc.a); cc.b.f = m1; printf("#0772:f:%16x\n",cc.a); printf("#0773:3:%d %d\n",cc.b.c,cc.b.d); cc.a = m1; printf("#0775:f:%16x\n",cc.a); cc.b.a = zero; printf("#0777:a:%16x\n",cc.a); cc.b.b = zero; printf("#0779:b:%16x\n",cc.a); cc.b.c = zero; printf("#0781:c:%16x\n",cc.a); cc.b.d = zero; printf("#0783:d:%16x\n",cc.a); cc.b.e = zero; printf("#0785:e:%16x\n",cc.a); cc.b.f = zero; printf("#0787:f:%16x\n",cc.a); printf("#0788:3:%d %d\n",cc.b.c,cc.b.d); cc.a = zero; printf("#0790:f:%16x\n",cc.a); cc.b.a = p1; printf("#0792:a:%16x\n",cc.a); cc.b.b = p1; printf("#0794:b:%16x\n",cc.a); cc.b.c = p1; printf("#0796:c:%16x\n",cc.a); cc.b.d = p1; printf("#0798:d:%16x\n",cc.a); cc.b.e = p1; printf("#0800:e:%16x\n",cc.a); cc.b.f = p1; printf("#0802:f:%16x\n",cc.a); printf("#0803:3:%d %d\n",cc.b.c,cc.b.d); cc.a = m1; printf("#0805:f:%16x\n",cc.a); cc.b.a = p1; printf("#0807:a:%16x\n",cc.a); cc.b.b = p1; printf("#0809:b:%16x\n",cc.a); cc.b.c = p1; printf("#0811:c:%16x\n",cc.a); cc.b.d = p1; printf("#0813:d:%16x\n",cc.a); cc.b.e = p1; printf("#0815:e:%16x\n",cc.a); cc.b.f = p1; printf("#0817:f:%16x\n",cc.a); printf("#0818:3:%d %d\n",cc.b.c,cc.b.d); ii.b.a = m1; printf("#0821:6:%16x\n",ii.a); ii.b.d = m1; printf("#0823:6:%16x\n",ii.a); printf("#0824:5:%d %d\n",ii.b.a,ii.b.d); } int main3l( int a ) { // int b:9; // nor local variable long long b,i; i = 7; g.pte.lpn = -333; printf("#0836:main3l-0: %lld\n",b); b = g.pte.lpn--; printf("#0838:main3l-1: %lld\n",b); b = g.pte.lpn++; printf("#0840:main3l-2: %lld\n",b); b = --g.pte.lpn; printf("#0842:main3l-3: %lld\n",b); b = ++g.pte.lpn; printf("#0844:main3l-4: %lld\n",b); b = (g.pte.lpn += 3); printf("#0846:main3l-5: %lld\n",b); b = (g.pte.lpn -= 3); printf("#0848:main3l-6: %lld\n",b); b = (g.pte.lpn *= 3); printf("#0850:main3l-7: %lld\n",b); b = (g.pte.lpn /= 3); printf("#0852:main3l-8: %lld\n",b); b = (g.pte.lpn %= 3); printf("#0854:main3l-9: %lld\n",b); b = (g.pte.lpn |= 3); printf("#0856:main3l-10: %lld\n",b); b = (g.pte.lpn &= 3); printf("#0858:main3l-12: %lld\n",b); b = (g.pte.lpn ^= 3); printf("#0860:main3l-13: %lld\n",b); b = (g.pte.lpn <<= 3); printf("#0862:main3l-14: %lld\n",b); b = (g.pte.lpn >>= 3); printf("#0864:main3l-15: %lld\n",b); g.pte.lpn = -333; printf("#0867:main3l-16: %lld\n",b); b = g.pte.lpn--; printf("#0869:main3l-17: %lld\n",b); b = g.pte.lpn++; printf("#0871:main3l-18: %lld\n",b); b = --g.pte.lpn; printf("#0873:main3l-19: %lld\n",b); b = ++g.pte.lpn; printf("#0875:main3l-20: %lld\n",b); b = (g.pte.lpn += i); printf("#0877:main3l-21: %lld\n",b); b = (g.pte.lpn -= i); printf("#0879:main3l-22: %lld\n",b); b = (g.pte.lpn *= i); printf("#0881:main3l-23: %lld\n",b); b = (g.pte.lpn /= i); printf("#0883:main3l-24: %lld\n",b); b = (g.pte.lpn %= i); printf("#0885:main3l-25: %lld\n",b); b = (g.pte.lpn |= i); printf("#0887:main3l-26: %lld\n",b); b = (g.pte.lpn &= i); printf("#0889:main3l-27: %lld\n",b); b = (g.pte.lpn ^= i); printf("#0891:main3l-28: %lld\n",b); b = (g.pte.lpn <<= i); printf("#0893:main3l-29: %lld\n",b); b = (g.pte.lpn >>= i); printf("#0895:main3l-30: %lld\n",b); return --b; } void main6() { int i =0; g.pte.api = 0; printf("#0905:main5: %d %d\n",i++,g.pte.api); g.pte.api = 1; printf("#0907:main5: %d %d\n",i++,g.pte.api); g.pte.api = 2; printf("#0909:main5: %d %d\n",i++,g.pte.api); g.pte.api = 3; printf("#0911:main5: %d %d\n",i++,g.pte.api); g.pte.api = 4; printf("#0913:main5: %d %d\n",i++,g.pte.api); g.pte.api = 5; printf("#0915:main5: %d %d\n",i++,g.pte.api); g.pte.api = 6; printf("#0917:main5: %d %d\n",i++,g.pte.api); g.pte.api = 7; printf("#0919:main5: %d %d\n",i++,g.pte.api); g.pte.api = 8; printf("#0921:main5: %d %d\n",i++,g.pte.api); g.pte.api = 9; printf("#0923:main5: %d %d\n",i++,g.pte.api); g.pte.api = 10; printf("#0925:main5: %d %d\n",i++,g.pte.api); g.pte.api = 11; printf("#0927:main5: %d %d\n",i++,g.pte.api); g.pte.api = 12; printf("#0929:main5: %d %d\n",i++,g.pte.api); g.pte.api = 13; printf("#0931:main5: %d %d\n",i++,g.pte.api); g.pte.api = 14; printf("#0933:main5: %d %d\n",i++,g.pte.api); g.pte.api = 15; printf("#0935:main5: %d %d\n",i++,g.pte.api); g.pte.api = 16; printf("#0937:main5: %d %d\n",i++,g.pte.api); g.pte.api = 17; printf("#0939:main5: %d %d\n",i++,g.pte.api); g.pte.api = 18; printf("#0941:main5: %d %d\n",i++,g.pte.api); g.pte.api = 19; printf("#0943:main5: %d %d\n",i++,g.pte.api); g.pte.api = 20; printf("#0945:main5: %d %d\n",i++,g.pte.api); g.pte.api = 21; printf("#0947:main5: %d %d\n",i++,g.pte.api); g.pte.api = 22; printf("#0949:main5: %d %d\n",i++,g.pte.api); g.pte.api = 23; printf("#0951:main5: %d %d\n",i++,g.pte.api); g.pte.api = 24; printf("#0953:main5: %d %d\n",i++,g.pte.api); g.pte.api = 25; printf("#0955:main5: %d %d\n",i++,g.pte.api); g.pte.api = 26; printf("#0957:main5: %d %d\n",i++,g.pte.api); g.pte.api = 27; printf("#0959:main5: %d %d\n",i++,g.pte.api); g.pte.api = 28; printf("#0961:main5: %d %d\n",i++,g.pte.api); g.pte.api = 29; printf("#0963:main5: %d %d\n",i++,g.pte.api); g.pte.api = 30; printf("#0965:main5: %d %d\n",i++,g.pte.api); g.pte.api = 31; printf("#0967:main5: %d %d\n",i++,g.pte.api); g.pte.api = 32; printf("#0969:main5: %d %d\n",i++,g.pte.api); g.pte.api = 33; printf("#0971:main5: %d %d\n",i++,g.pte.api); g.pte.api = 34; printf("#0973:main5: %d %d\n",i++,g.pte.api); g.pte.api = 35; printf("#0975:main5: %d %d\n",i++,g.pte.api); g.pte.api = 36; printf("#0977:main5: %d %d\n",i++,g.pte.api); g.pte.api = 37; printf("#0979:main5: %d %d\n",i++,g.pte.api); g.pte.api = 38; printf("#0981:main5: %d %d\n",i++,g.pte.api); g.pte.api = 39; printf("#0983:main5: %d %d\n",i++,g.pte.api); g.pte.api = 40; printf("#0985:main5: %d %d\n",i++,g.pte.api); g.pte.api = 41; printf("#0987:main5: %d %d\n",i++,g.pte.api); g.pte.api = 42; printf("#0989:main5: %d %d\n",i++,g.pte.api); g.pte.api = 43; printf("#0991:main5: %d %d\n",i++,g.pte.api); g.pte.api = 44; printf("#0993:main5: %d %d\n",i++,g.pte.api); g.pte.api = 45; printf("#0995:main5: %d %d\n",i++,g.pte.api); g.pte.api = 46; printf("#0997:main5: %d %d\n",i++,g.pte.api); g.pte.api = 47; printf("#0999:main5: %d %d\n",i++,g.pte.api); g.pte.api = 48; printf("#1001:main5: %d %d\n",i++,g.pte.api); g.pte.api = 49; printf("#1003:main5: %d %d\n",i++,g.pte.api); g.pte.api = 50; printf("#1005:main5: %d %d\n",i++,g.pte.api); g.pte.api = 51; printf("#1007:main5: %d %d\n",i++,g.pte.api); g.pte.api = 52; printf("#1009:main5: %d %d\n",i++,g.pte.api); g.pte.api = 53; printf("#1011:main5: %d %d\n",i++,g.pte.api); g.pte.api = 54; printf("#1013:main5: %d %d\n",i++,g.pte.api); g.pte.api = 55; printf("#1015:main5: %d %d\n",i++,g.pte.api); g.pte.api = 56; printf("#1017:main5: %d %d\n",i++,g.pte.api); g.pte.api = 57; printf("#1019:main5: %d %d\n",i++,g.pte.api); g.pte.api = 58; printf("#1021:main5: %d %d\n",i++,g.pte.api); g.pte.api = 59; printf("#1023:main5: %d %d\n",i++,g.pte.api); g.pte.api = 60; printf("#1025:main5: %d %d\n",i++,g.pte.api); g.pte.api = 61; printf("#1027:main5: %d %d\n",i++,g.pte.api); g.pte.api = 62; printf("#1029:main5: %d %d\n",i++,g.pte.api); g.pte.api = 63; printf("#1031:main5: %d %d\n",i++,g.pte.api); } void main7() { int i; for (i=-2;i<2;i++) { g.pte.api = i; if (g.pte.api) { printf("#1040:main 7:1 %d yes\n",i); } else { printf("#1042:main 7:1 %d no\n",i); } if (g.pte.api==1) { printf("#1045:main 7:2 %d yes\n",i); } else { printf("#1047:main 7:2 %d no\n",i); } if (g.pte.api==-1) { printf("#1050:main 7:3 %d yes\n",i); } else { printf("#1052:main 7:3 %d no\n",i); } } for (i=-2;i<2;i++) { g.sg.v = i; if (g.sg.v) { printf("#1058:main 7:4 %d yes\n",i); } else { printf("#1060:main 7:4 %d no\n",i); } if (g.sg.v==1) { // always false printf("#1063:main 7:5 %d yes\n",i); } else { printf("#1065:main 7:5 %d no\n",i); } if (g.sg.v==-1) { printf("#1068:main 7:6 %d yes\n",i); } else { printf("#1070:main 7:6 %d no\n",i); } } } /* end */