1 struct tmp 2 { 3 long long int pad : 12; 4 long long int field : 52; 5 }; 6 7 struct tmp2 8 { 9 long long int field : 52; 10 long long int pad : 12; 11 }; 12 13 struct tmp3 14 { 15 long long int pad : 11; 16 long long int field : 53; 17 }; 18 19 struct tmp4 20 { 21 long long int field : 53; 22 long long int pad : 11; 23 }; 24 25 struct tmp sub(struct tmp tmp)26sub (struct tmp tmp) 27 { 28 tmp.field ^= 0x0008765412345678LL; 29 return tmp; 30 } 31 32 struct tmp2 sub2(struct tmp2 tmp2)33sub2 (struct tmp2 tmp2) 34 { 35 tmp2.field ^= 0x0008765412345678LL; 36 return tmp2; 37 } 38 39 struct tmp3 sub3(struct tmp3 tmp3)40sub3 (struct tmp3 tmp3) 41 { 42 tmp3.field ^= 0x0018765412345678LL; 43 return tmp3; 44 } 45 46 struct tmp4 sub4(struct tmp4 tmp4)47sub4 (struct tmp4 tmp4) 48 { 49 tmp4.field ^= 0x0018765412345678LL; 50 return tmp4; 51 } 52 53 struct tmp tmp = {0x123, 0x123456789ABCDLL}; 54 struct tmp2 tmp2 = {0x123456789ABCDLL, 0x123}; 55 struct tmp3 tmp3 = {0x123, 0x1FFFF00000000LL}; 56 struct tmp4 tmp4 = {0x1FFFF00000000LL, 0x123}; 57 main()58main() 59 { 60 61 if (sizeof (long long) != 8) 62 exit (0); 63 64 tmp = sub (tmp); 65 tmp2 = sub2 (tmp2); 66 67 if (tmp.pad != 0x123 || tmp.field != 0xFFF9551175BDFDB5LL) 68 abort (); 69 if (tmp2.pad != 0x123 || tmp2.field != 0xFFF9551175BDFDB5LL) 70 abort (); 71 72 tmp3 = sub3 (tmp3); 73 tmp4 = sub4 (tmp4); 74 if (tmp3.pad != 0x123 || tmp3.field != 0xFFF989AB12345678LL) 75 abort (); 76 if (tmp4.pad != 0x123 || tmp4.field != 0xFFF989AB12345678LL) 77 abort (); 78 exit (0); 79 } 80