Pick three bugfixes from next branch to trunk for inclusion in 4.5.0 RC2, as discusse...
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-20020904-1.c
blob56509c12ed0e66f2f5a2ccda907bd25d31606ce5
1 /*
2 20020904-1.c from the execute part of the gcc torture suite.
3 */
5 #include <testfwk.h>
7 #ifdef __SDCC
8 #pragma std_c99
9 #endif
11 /* PR c/7102 */
13 /* Verify that GCC zero-extends integer constants
14 in unsigned binary operations. */
16 typedef unsigned char u8;
18 u8 fun(u8 y)
20 u8 x=((u8)255)/y;
21 return x;
24 void testTortureExecute(void)
26 if (fun((u8)2) != 127)
27 ASSERT(0);
28 return;