2 20040409-3.c from the execute part of the gcc torture suite.
15 return ~(x
^ INT_MIN
);
18 unsigned int ftest1u(unsigned int x
)
20 return ~(x
^ (unsigned int)INT_MIN
);
25 return ~(x
+ INT_MIN
);
28 unsigned int ftest2u(unsigned int x
)
30 return ~(x
+ (unsigned int)INT_MIN
);
33 unsigned int ftest3u(unsigned int x
)
35 return ~(x
- (unsigned int)INT_MIN
);
44 unsigned int ftest4u(unsigned int x
)
46 unsigned int y
= (unsigned int)INT_MIN
;
56 unsigned int ftest5u(unsigned int x
)
58 unsigned int y
= (unsigned int)INT_MIN
;
62 unsigned int ftest6u(unsigned int x
)
64 unsigned int y
= (unsigned int)INT_MIN
;
70 void ftest(int a
, int b
)
74 #if 0 // This tests triggers signed integer overflow, which is undefined behaviour in C (though GCC apparently makes it implementation-defined, and tests for the implementation-defined behaviour here).
80 #if 0 // This tests triggers signed integer overflow, which is undefined behaviour in C (though GCC apparently makes it implementation-defined, and tests for the implementation-defined behaviour here).
86 void ftestu(unsigned int a
, unsigned int b
)
104 testTortureExecute (void)
106 #if INT_MAX == 2147483647
107 ftest(0x00000000,0x7fffffff);
108 ftest(0x80000000,0xffffffff);
109 ftest(0x12345678,0x6dcba987);
110 ftest(0x92345678,0xedcba987);
111 ftest(0x7fffffff,0x00000000);
112 ftest(0xffffffff,0x80000000);
114 ftestu(0x00000000,0x7fffffff);
115 ftestu(0x80000000,0xffffffff);
116 ftestu(0x12345678,0x6dcba987);
117 ftestu(0x92345678,0xedcba987);
118 ftestu(0x7fffffff,0x00000000);
119 ftestu(0xffffffff,0x80000000);
123 ftest(0x0000,0x7fff);
124 ftest(0x8000,0xffff);
125 ftest(0x1234,0x6dcb);
126 ftest(0x9234,0xedcb);
127 ftest(0x7fff,0x0000);
128 ftest(0xffff,0x8000);
130 ftestu(0x0000,0x7fff);
131 ftestu(0x8000,0xffff);
132 ftestu(0x1234,0x6dcb);
133 ftestu(0x9234,0xedcb);
134 ftestu(0x7fff,0x0000);
135 ftestu(0xffff,0x8000);