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-pr42006.c
blob3f7a3d5b82a563555339b2c602813bdf4661fd87
1 /*
2 pr42006.c from the execute part of the gcc torture tests.
3 */
5 #include <testfwk.h>
7 #ifdef __SDCC
8 #pragma std_c99
9 #endif
11 static unsigned int
12 my_add(unsigned int si1, unsigned int si2)
14 return (si1 > (50-si2)) ? si1 : (si1 + si2);
17 static unsigned int
18 my_shift(unsigned int left, unsigned int right)
20 return (right > 100) ? left : (left >> right);
23 static int func_4(unsigned int p_6)
25 int count = 0;
26 for (p_6 = 1; p_6 < 3; p_6 = my_add(p_6, 1))
28 if (count++ > 1)
29 ASSERT (0);
31 if (my_shift(p_6, p_6))
32 return 0;
34 return 0;
37 void
38 testTortureExecute (void)
40 func_4(0);
41 return;