struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-pr81503.c
blob4bfc0dfa92f96ab8448767ac31003c633c9f2e40
1 /*
2 pr81503.c from the execute part of the gcc torture tests.
3 */
5 #include <testfwk.h>
7 #include <stdint.h>
9 #if !defined(__SDCC_pdk14) // Lack of memory
10 unsigned short a = 41461;
11 unsigned short b = 3419;
12 #if __SIZEOF_INT__ >= 4
13 int c = 0;
15 void foo() {
16 if (a + b * ~(0 != 5))
17 c = -~(b * ~(0 != 5)) + 2147483647;
19 #else
20 int32_t c = 0;
22 void foo() {
23 if (a + b * ~((int32_t)(0 != 5)))
24 c = -~(b * ~((int32_t)(0 != 5))) + 2147483647;
26 #endif
27 #endif
29 void
30 testTortureExecute (void) {
31 #if !defined(__SDCC_pdk14) // Lack of memory
32 foo();
33 if (c != 2147476810)
34 ASSERT (0);
35 return;
36 #endif