2 20040409-1.c from the execute part of the gcc torture suite.
18 unsigned int ftest1u(unsigned int x
)
20 return x
^ (unsigned int)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,0x80000000);
108 ftest(0x80000000,0x00000000);
109 ftest(0x12345678,0x92345678);
110 ftest(0x92345678,0x12345678);
111 ftest(0x7fffffff,0xffffffff);
112 ftest(0xffffffff,0x7fffffff);
114 ftestu(0x00000000,0x80000000);
115 ftestu(0x80000000,0x00000000);
116 ftestu(0x12345678,0x92345678);
117 ftestu(0x92345678,0x12345678);
118 ftestu(0x7fffffff,0xffffffff);
119 ftestu(0xffffffff,0x7fffffff);
123 ftest(0x0000,0x8000);
124 ftest(0x8000,0x0000);
125 ftest(0x1234,0x9234);
126 ftest(0x9234,0x1234);
127 ftest(0x7fff,0xffff);
128 ftest(0xffff,0x7fff);
130 ftestu(0x0000,0x8000);
131 ftestu(0x8000,0x0000);
132 ftestu(0x1234,0x9234);
133 ftestu(0x9234,0x1234);
134 ftestu(0x7fff,0xffff);
135 ftestu(0xffff,0x7fff);