struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-20101013-1.c
blob05adcc0ce9f4d7e4dca9c881dd310bcae22ff94f
1 /*
2 20101013-1.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_pic14) && !defined(__SDCC_pic16) && !defined(__SDCC_pdk14)
13 /* PR rtl-optimization/45912 */
15 static void*
16 get_addr_base_and_unit_offset (void *base, long long *i)
18 *i = 0;
19 return base;
22 static void*
23 build_int_cst (void *base, long long offset)
25 if (offset != 4)
26 ASSERT (0);
28 return base;
31 static void*
32 build_ref_for_offset (void *base, long long offset)
34 long long base_offset;
35 base = get_addr_base_and_unit_offset (base, &base_offset);
36 return build_int_cst (base, base_offset + offset / 8);
38 #endif
40 void
41 testTortureExecute (void)
43 #if !defined(__SDCC_pic14) && !defined(__SDCC_pic16) && !defined(__SDCC_pdk14)
44 void *ret = build_ref_for_offset ((void *)0, 32);
45 if (ret != (void *)0)
46 ASSERT (0);
47 return;
48 #endif