struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-991112-1.c
blob10524b3543d3f0008231cf99f96264f59422fbbe
1 /*
2 991112-1.c from the execute part of the gcc torture tests.
3 */
5 #include <testfwk.h>
7 #ifdef __SDCC
8 #pragma std_c99
9 #pragma disable_warning 85
10 #endif
12 #include <ctype.h>
14 /* This code was miscompiled at -O3 on x86.
15 Reported by Jim Meyering; distilled from bash. */
17 int rl_show_char (int c) { return 0; }
19 int rl_character_len (int c, int pos)
21 return isprint (c) ? 1 : 2;
24 void
25 testTortureExecute (void)
27 #if !defined (__SDCC_hc08) && !defined (__SDCC_s08) && !defined(__SDCC_mos6502) && !defined(__SDCC_mos65c02) && !defined (__SDCC_ds390) && !defined (__SDCC_mcs51) && !defined (__SDCC_pdk14) && !defined (__SDCC_pdk15)
28 int (*x)(int, int) = rl_character_len;
29 if (x('a', 1) != 1)
30 ASSERT (0);
31 if (x('\002', 1) != 2)
32 ASSERT (0);
33 return;
34 #endif