Mercurial > hg > CbC > old > device
view test/const.c @ 792:3622e3f561db
struct offset alignment
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 22 Nov 2010 14:14:15 +0900 |
parents | 2f577690bcfb |
children | c55337499f96 |
line wrap: on
line source
int printf(const char *format, ...); int main() { int i; i = 0x0f0f0ff; printf("#0006:0:\t%x\n",i); i = 0x0f0f0ff<<1; printf("#0008:1:\t%x\n",i); i = 1; printf("#0010:2:\t%x\n",i); i = -1; printf("#0011:3:\t%x\n",i); if (i==1) printf("#0012:i==1\n",i); if (i==-1) printf("#0013:i==-1\n",i); i = 0x555<<0; printf("#0015:4:\t%x\n",i); i = 0x555<<1; printf("#0016:5:\t%x\n",i); i = 0x555<<2; printf("#0017:6:\t%x\n",i); i = 0x555<<3; printf("#0018:7:\t%x\n",i); i = 0x555<<4; printf("#0019:8:\t%x\n",i); i = 0x555<<5; printf("#0020:9:\t%x\n",i); i = 0x555<<6; printf("#0021:10:\t%x\n",i); i = 0x555<<7; printf("#0022:11:\t%x\n",i); i = 0x555<<8; printf("#0023:12:\t%x\n",i); i = 0x555<<9; printf("#0024:13:\t%x\n",i); i = 0x555<<10; printf("#0025:14:\t%x\n",i); i = 0x555<<11; printf("#0026:15:\t%x\n",i); i = 0x555<<12; printf("#0027:16:\t%x\n",i); i = 0x555<<13; printf("#0028:17:\t%x\n",i); i = 0x555<<14; printf("#0029:18:\t%x\n",i); i = 0x555<<15; printf("#0030:19:\t%x\n",i); i = 0x555<<16; printf("#0031:20:\t%x\n",i); i = 0x555<<17; printf("#0032:21:\t%x\n",i); i = 0x555<<18; printf("#0033:22:\t%x\n",i); i = 0x555<<19; printf("#0034:23:\t%x\n",i); i = 0x555<<20; printf("#0035:24:\t%x\n",i); i = 0x555<<21; printf("#0036:25:\t%x\n",i); i = 0x555<<22; printf("#0037:26:\t%x\n",i); i = 0x555<<23; printf("#0038:27:\t%x\n",i); i = 0x555<<24; printf("#0039:28:\t%x\n",i); i = 0x555<<25; printf("#0040:29:\t%x\n",i); i = 0x555<<26; printf("#0041:30:\t%x\n",i); i = 0x555<<27; printf("#0042:31:\t%x\n",i); i = 0x555<<28; printf("#0043:32:\t%x\n",i); i = 0x555<<29; printf("#0044:33:\t%x\n",i); i = 0x555<<30; printf("#0045:34:\t%x\n",i); i = 0x555<<31; printf("#0046:35:\t%x\n",i); i = 1; printf("#0048:36:\t%x\n",i); i = 3; printf("#0049:37:\t%x\n",i); i = 7; printf("#0050:38:\t%x\n",i); i = 15; printf("#0051:39:\t%x\n",i); i = 31; printf("#0052:40:\t%x\n",i); i = 63; printf("#0053:41:\t%x\n",i); i = 127; printf("#0054:42:\t%x\n",i); i = 255; printf("#0055:43:\t%x\n",i); i = 511; printf("#0056:44:\t%x\n",i); i = 1023; printf("#0057:45:\t%x\n",i); i = 2047; printf("#0058:46:\t%x\n",i); i = 4095; printf("#0059:47:\t%x\n",i); i = 8191; printf("#0060:48:\t%x\n",i); i = 16383; printf("#0061:49:\t%x\n",i); i = 32767; printf("#0062:50:\t%x\n",i); i = 65535; printf("#0063:51:\t%x\n",i); i = 131071; printf("#0064:52:\t%x\n",i); i = 262143; printf("#0065:53:\t%x\n",i); i = 524287; printf("#0066:54:\t%x\n",i); i = 1048575; printf("#0067:55:\t%x\n",i); i = 2097151; printf("#0068:56:\t%x\n",i); i = 4194303; printf("#0069:57:\t%x\n",i); i = 8388607; printf("#0070:58:\t%x\n",i); i = 16777215; printf("#0071:59:\t%x\n",i); i = 33554431; printf("#0072:60:\t%x\n",i); i = 67108863; printf("#0073:61:\t%x\n",i); i = 134217727; printf("#0074:62:\t%x\n",i); i = 268435455; printf("#0075:63:\t%x\n",i); i = 536870911; printf("#0076:64:\t%x\n",i); i = 1073741823; printf("#0077:65:\t%x\n",i); i = 2147483647; printf("#0078:66:\t%x\n",i); i = 4294967295; printf("#0079:67:\t%x\n",i); i = -( 0x555<<0 ); printf("#0081:68:\t%x\n",i); i = -( 0x555<<1 ); printf("#0082:69:\t%x\n",i); i = -( 0x555<<2 ); printf("#0083:70:\t%x\n",i); i = -( 0x555<<3 ); printf("#0084:71:\t%x\n",i); i = -( 0x555<<4 ); printf("#0085:72:\t%x\n",i); i = -( 0x555<<5 ); printf("#0086:73:\t%x\n",i); i = -( 0x555<<6 ); printf("#0087:74:\t%x\n",i); i = -( 0x555<<7 ); printf("#0088:75:\t%x\n",i); i = -( 0x555<<8 ); printf("#0089:76:\t%x\n",i); i = -( 0x555<<9 ); printf("#0090:77:\t%x\n",i); i = -( 0x555<<10 ); printf("#0091:78:\t%x\n",i); i = -( 0x555<<11 ); printf("#0092:79:\t%x\n",i); i = -( 0x555<<12 ); printf("#0093:80:\t%x\n",i); i = -( 0x555<<13 ); printf("#0094:81:\t%x\n",i); i = -( 0x555<<14 ); printf("#0095:82:\t%x\n",i); i = -( 0x555<<15 ); printf("#0096:83:\t%x\n",i); i = -( 0x555<<16 ); printf("#0097:84:\t%x\n",i); i = -( 0x555<<17 ); printf("#0098:85:\t%x\n",i); i = -( 0x555<<18 ); printf("#0099:86:\t%x\n",i); i = -( 0x555<<19 ); printf("#0100:87:\t%x\n",i); i = -( 0x555<<20 ); printf("#0101:88:\t%x\n",i); i = -( 0x555<<21 ); printf("#0102:89:\t%x\n",i); i = -( 0x555<<22 ); printf("#0103:90:\t%x\n",i); i = -( 0x555<<23 ); printf("#0104:91:\t%x\n",i); i = -( 0x555<<24 ); printf("#0105:92:\t%x\n",i); i = -( 0x555<<25 ); printf("#0106:93:\t%x\n",i); i = -( 0x555<<26 ); printf("#0107:94:\t%x\n",i); i = -( 0x555<<27 ); printf("#0108:95:\t%x\n",i); i = -( 0x555<<28 ); printf("#0109:96:\t%x\n",i); i = -( 0x555<<29 ); printf("#0110:97:\t%x\n",i); i = -( 0x555<<30 ); printf("#0111:98:\t%x\n",i); // i = -( 0x555<<31 ); printf("#0112:99:\t%x\n",i); i = -( 1 ); printf("#0114:100:\t%x\n",i); i = -( 3 ); printf("#0115:101:\t%x\n",i); i = -( 7 ); printf("#0116:102:\t%x\n",i); i = -( 15 ); printf("#0117:103:\t%x\n",i); i = -( 31 ); printf("#0118:104:\t%x\n",i); i = -( 63 ); printf("#0119:105:\t%x\n",i); i = -( 127 ); printf("#0120:106:\t%x\n",i); i = -( 255 ); printf("#0121:107:\t%x\n",i); i = -( 511 ); printf("#0122:108:\t%x\n",i); i = -( 1023 ); printf("#0123:109:\t%x\n",i); i = -( 2047 ); printf("#0124:110:\t%x\n",i); i = -( 4095 ); printf("#0125:111:\t%x\n",i); i = -( 8191 ); printf("#0126:112:\t%x\n",i); i = -( 16383 ); printf("#0127:113:\t%x\n",i); i = -( 32767 ); printf("#0128:114:\t%x\n",i); i = -( 65535 ); printf("#0129:115:\t%x\n",i); i = -( 131071 ); printf("#0130:116:\t%x\n",i); i = -( 262143 ); printf("#0131:117:\t%x\n",i); i = -( 524287 ); printf("#0132:118:\t%x\n",i); i = -( 1048575 ); printf("#0133:119:\t%x\n",i); i = -( 2097151 ); printf("#0134:120:\t%x\n",i); i = -( 4194303 ); printf("#0135:121:\t%x\n",i); i = -( 8388607 ); printf("#0136:122:\t%x\n",i); i = -( 16777215 ); printf("#0137:123:\t%x\n",i); i = -( 33554431 ); printf("#0138:124:\t%x\n",i); i = -( 67108863 ); printf("#0139:125:\t%x\n",i); i = -( 134217727 ); printf("#0140:126:\t%x\n",i); i = -( 268435455 ); printf("#0141:127:\t%x\n",i); i = -( 536870911 ); printf("#0142:128:\t%x\n",i); i = -( 1073741823 ); printf("#0143:129:\t%x\n",i); i = -( 2147483647 ); printf("#0144:130:\t%x\n",i); // i = -( 4294967295 ); printf("#0145:131:\t%x\n",i); i += 0x555<<0; printf("#0147:132:\t%x\n",i); i += 0x555<<1; printf("#0148:133:\t%x\n",i); i += 0x555<<2; printf("#0149:134:\t%x\n",i); i += 0x555<<3; printf("#0150:135:\t%x\n",i); i += 0x555<<4; printf("#0151:136:\t%x\n",i); i += 0x555<<5; printf("#0152:137:\t%x\n",i); i += 0x555<<6; printf("#0153:138:\t%x\n",i); i += 0x555<<7; printf("#0154:139:\t%x\n",i); i += 0x555<<8; printf("#0155:140:\t%x\n",i); i += 0x555<<9; printf("#0156:141:\t%x\n",i); i += 0x555<<10; printf("#0157:142:\t%x\n",i); i += 0x555<<11; printf("#0158:143:\t%x\n",i); i += 0x555<<12; printf("#0159:144:\t%x\n",i); i += 0x555<<13; printf("#0160:145:\t%x\n",i); i += 0x555<<14; printf("#0161:146:\t%x\n",i); i += 0x555<<15; printf("#0162:147:\t%x\n",i); i += 0x555<<16; printf("#0163:148:\t%x\n",i); i += 0x555<<17; printf("#0164:149:\t%x\n",i); i += 0x555<<18; printf("#0165:150:\t%x\n",i); i += 0x555<<19; printf("#0166:151:\t%x\n",i); i += 0x555<<20; printf("#0167:152:\t%x\n",i); i += 0x555<<21; printf("#0168:153:\t%x\n",i); i += 0x555<<22; printf("#0169:154:\t%x\n",i); i += 0x555<<23; printf("#0170:155:\t%x\n",i); i += 0x555<<24; printf("#0171:156:\t%x\n",i); i += 0x555<<25; printf("#0172:157:\t%x\n",i); i += 0x555<<26; printf("#0173:158:\t%x\n",i); i += 0x555<<27; printf("#0174:159:\t%x\n",i); i += 0x555<<28; printf("#0175:160:\t%x\n",i); i += 0x555<<29; printf("#0176:161:\t%x\n",i); i += 0x555<<30; printf("#0177:162:\t%x\n",i); i += 0x555<<31; printf("#0178:163:\t%x\n",i); i += 1; printf("#0180:164:\t%x\n",i); i += 3; printf("#0181:165:\t%x\n",i); i += 7; printf("#0182:166:\t%x\n",i); i += 15; printf("#0183:167:\t%x\n",i); i += 31; printf("#0184:168:\t%x\n",i); i += 63; printf("#0185:169:\t%x\n",i); i += 127; printf("#0186:170:\t%x\n",i); i += 255; printf("#0187:171:\t%x\n",i); i += 511; printf("#0188:172:\t%x\n",i); i += 1023; printf("#0189:173:\t%x\n",i); i += 2047; printf("#0190:174:\t%x\n",i); i += 4095; printf("#0191:175:\t%x\n",i); i += 8191; printf("#0192:176:\t%x\n",i); i += 16383; printf("#0193:177:\t%x\n",i); i += 32767; printf("#0194:178:\t%x\n",i); i += 65535; printf("#0195:179:\t%x\n",i); i += 131071; printf("#0196:180:\t%x\n",i); i += 262143; printf("#0197:181:\t%x\n",i); i += 524287; printf("#0198:182:\t%x\n",i); i += 1048575; printf("#0199:183:\t%x\n",i); i += 2097151; printf("#0200:184:\t%x\n",i); i += 4194303; printf("#0201:185:\t%x\n",i); i += 8388607; printf("#0202:186:\t%x\n",i); i += 16777215; printf("#0203:187:\t%x\n",i); i += 33554431; printf("#0204:188:\t%x\n",i); i += 67108863; printf("#0205:189:\t%x\n",i); i += 134217727; printf("#0206:190:\t%x\n",i); i += 268435455; printf("#0207:191:\t%x\n",i); i += 536870911; printf("#0208:192:\t%x\n",i); i += 1073741823; printf("#0209:193:\t%x\n",i); i += 2147483647; printf("#0210:194:\t%x\n",i); i += 4294967295; printf("#0211:195:\t%x\n",i); i += -( 0x555<<0 ); printf("#0213:196:\t%x\n",i); i += -( 0x555<<1 ); printf("#0214:197:\t%x\n",i); i += -( 0x555<<2 ); printf("#0215:198:\t%x\n",i); i += -( 0x555<<3 ); printf("#0216:199:\t%x\n",i); i += -( 0x555<<4 ); printf("#0217:200:\t%x\n",i); i += -( 0x555<<5 ); printf("#0218:201:\t%x\n",i); i += -( 0x555<<6 ); printf("#0219:202:\t%x\n",i); i += -( 0x555<<7 ); printf("#0220:203:\t%x\n",i); i += -( 0x555<<8 ); printf("#0221:204:\t%x\n",i); i += -( 0x555<<9 ); printf("#0222:205:\t%x\n",i); i += -( 0x555<<10 ); printf("#0223:206:\t%x\n",i); i += -( 0x555<<11 ); printf("#0224:207:\t%x\n",i); i += -( 0x555<<12 ); printf("#0225:208:\t%x\n",i); i += -( 0x555<<13 ); printf("#0226:209:\t%x\n",i); i += -( 0x555<<14 ); printf("#0227:210:\t%x\n",i); i += -( 0x555<<15 ); printf("#0228:211:\t%x\n",i); i += -( 0x555<<16 ); printf("#0229:212:\t%x\n",i); i += -( 0x555<<17 ); printf("#0230:213:\t%x\n",i); i += -( 0x555<<18 ); printf("#0231:214:\t%x\n",i); i += -( 0x555<<19 ); printf("#0232:215:\t%x\n",i); i += -( 0x555<<20 ); printf("#0233:216:\t%x\n",i); i += -( 0x555<<21 ); printf("#0234:217:\t%x\n",i); i += -( 0x555<<22 ); printf("#0235:218:\t%x\n",i); i += -( 0x555<<23 ); printf("#0236:219:\t%x\n",i); i += -( 0x555<<24 ); printf("#0237:220:\t%x\n",i); i += -( 0x555<<25 ); printf("#0238:221:\t%x\n",i); i += -( 0x555<<26 ); printf("#0239:222:\t%x\n",i); i += -( 0x555<<27 ); printf("#0240:223:\t%x\n",i); i += -( 0x555<<28 ); printf("#0241:224:\t%x\n",i); i += -( 0x555<<29 ); printf("#0242:225:\t%x\n",i); i += -( 0x555<<30 ); printf("#0243:226:\t%x\n",i); // i += -( 0x555<<31 ); printf("#0244:227:\t%x\n",i); i += -( 1 ); printf("#0246:228:\t%x\n",i); i += -( 3 ); printf("#0247:229:\t%x\n",i); i += -( 7 ); printf("#0248:230:\t%x\n",i); i += -( 15 ); printf("#0249:231:\t%x\n",i); i += -( 31 ); printf("#0250:232:\t%x\n",i); i += -( 63 ); printf("#0251:233:\t%x\n",i); i += -( 127 ); printf("#0252:234:\t%x\n",i); i += -( 255 ); printf("#0253:235:\t%x\n",i); i += -( 511 ); printf("#0254:236:\t%x\n",i); i += -( 1023 ); printf("#0255:237:\t%x\n",i); i += -( 2047 ); printf("#0256:238:\t%x\n",i); i += -( 4095 ); printf("#0257:239:\t%x\n",i); i += -( 8191 ); printf("#0258:240:\t%x\n",i); i += -( 16383 ); printf("#0259:241:\t%x\n",i); i += -( 32767 ); printf("#0260:242:\t%x\n",i); i += -( 65535 ); printf("#0261:243:\t%x\n",i); i += -( 131071 ); printf("#0262:244:\t%x\n",i); i += -( 262143 ); printf("#0263:245:\t%x\n",i); i += -( 524287 ); printf("#0264:246:\t%x\n",i); i += -( 1048575 ); printf("#0265:247:\t%x\n",i); i += -( 2097151 ); printf("#0266:248:\t%x\n",i); i += -( 4194303 ); printf("#0267:249:\t%x\n",i); i += -( 8388607 ); printf("#0268:250:\t%x\n",i); i += -( 16777215 ); printf("#0269:251:\t%x\n",i); i += -( 33554431 ); printf("#0270:252:\t%x\n",i); i += -( 67108863 ); printf("#0271:253:\t%x\n",i); i += -( 134217727 ); printf("#0272:254:\t%x\n",i); i += -( 268435455 ); printf("#0273:255:\t%x\n",i); i += -( 536870911 ); printf("#0274:256:\t%x\n",i); i += -( 1073741823 ); printf("#0275:257:\t%x\n",i); i += -( 2147483647 ); printf("#0276:258:\t%x\n",i); i += -( 4294967295 ); printf("#0277:259:\t%x\n",i); return 0; }