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-20111227-1.c
blob6844746946bd7657cd243d744e2d6d12e3bc3c86
1 /*
2 20111227-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 rtl-optimization/51667 */
12 /* Testcase by Uros Bizjak <ubizjak@gmail.com> */
14 void
15 bar (int a)
17 if (a != -1)
18 ASSERT (0);
21 void
22 foo (short *a, int t)
24 short r = *a;
26 if (t)
27 bar ((unsigned short) r);
28 else
29 bar ((signed short) r);
32 short v = -1;
34 void
35 testTortureExecute (void)
37 foo (&v, 0);