struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-pr78791.c
blob0693efafdb6777c42ecbf8a21ac59675b92c1571
1 /*
2 pr78791.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 #if !defined(__SDCC_pdk14) // Lack of memory
12 #if !(defined (__SDCC_pdk15) && defined(__SDCC_STACK_AUTO)) // Lack of code memory
13 /* PR target/78791 */
14 unsigned long long
15 foo (unsigned long long x, unsigned long long y, unsigned long long z)
17 unsigned long long a = x / y;
18 unsigned long long b = x % y;
19 a |= z;
20 b ^= z;
21 return a + b;
23 #endif
24 #endif
26 void
27 testTortureExecute (void)
29 #if !defined(__SDCC_pdk14) // Lack of memory
30 #if !(defined (__SDCC_pdk15) && defined(__SDCC_STACK_AUTO)) // Lack of code memory
31 if (foo (64, 7, 0) != 10 || foo (28, 3, 2) != 14)
32 ASSERT (0);
33 return;
34 #endif
35 #endif