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-20100416-1.c
bloba57cb2773bd879bd8157f30fb740aaad44cb162e
1 /*
2 20100416-1.c from the execute part of the gcc torture tests.
3 */
5 #include <testfwk.h>
7 int
8 movegt(int x, int y, long long a)
10 int i;
11 int ret = 0;
12 for (i = 0; i < y; i++)
14 if (a >= (long long) 0xf000000000000000LL)
15 ret = x;
16 else
17 ret = y;
19 return ret;
22 #ifndef __SDCC_pdk14 // Lack of memory
23 struct test
25 long long val;
26 int ret;
27 } tests[] = {
28 { 0xf000000000000000LL, -1 },
29 { 0xefffffffffffffffLL, 1 },
30 { 0xf000000000000001LL, -1 },
31 { 0x0000000000000000LL, -1 },
32 { 0x8000000000000000LL, 1 },
34 #endif
36 void
37 testTortureExecute (void)
39 #ifndef __SDCC_pdk14 // Lack of memory
40 int i;
41 for (i = 0; i < sizeof (tests) / sizeof (tests[0]); i++)
43 if (movegt (-1, 1, tests[i].val) != tests[i].ret)
44 ASSERT (0);
46 return;
47 #endif