struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-990211-1.c
blob5f373543dbbcbf0c63cb657943705aa11546995a
1 /*
2 990211-1.c from the execute part of the gcc torture suite.
3 */
5 #include <testfwk.h>
7 #ifdef __SDCC
8 #pragma std_c99
9 #endif
11 /* Copyright (C) 1999 Free Software Foundation, Inc.
12 Contributed by Nathan Sidwell 20 Jan 1999 <nathan@acm.org> */
14 /* check range combining boolean operations work */
16 #define N 77
18 void func(int i)
20 /* fold-const does some clever things with range tests. Make sure
21 we get (some of) them right */
23 /* these must fail, regardless of the value of i */
24 if ((i < 0) && (i >= 0))
25 ASSERT(0);
26 if ((i > 0) && (i <= 0))
27 ASSERT(0);
28 if ((i >= 0) && (i < 0))
29 ASSERT(0);
30 if ((i <= 0) && (i > 0))
31 ASSERT(0);
33 if ((i < N) && (i >= N))
34 ASSERT(0);
35 if ((i > N) && (i <= N))
36 ASSERT(0);
37 if ((i >= N) && (i < N))
38 ASSERT(0);
39 if ((i <= N) && (i > N))
40 ASSERT(0);
42 /* these must pass, regardless of the value of i */
43 if (! ((i < 0) || (i >= 0)))
44 ASSERT(0);
45 if (! ((i > 0) || (i <= 0)))
46 ASSERT(0);
47 if (! ((i >= 0) || (i < 0)))
48 ASSERT(0);
49 if (! ((i <= 0) || (i > 0)))
50 ASSERT(0);
52 if (! ((i < N) || (i >= N)))
53 ASSERT(0);
54 if (! ((i > N) || (i <= N)))
55 ASSERT(0);
56 if (! ((i >= N) || (i < N)))
57 ASSERT(0);
58 if (! ((i <= N) || (i > N)))
59 ASSERT(0);
61 return;
64 void
65 testTortureExecute (void)
67 func(0);
68 func(1);
69 return;