2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / 990211-1.c
blobe2fe7eea398670692340b892cd664e4fe8d2d8e5
1 /* Copyright (C) 1999 Free Software Foundation, Inc.
2 Contributed by Nathan Sidwell 20 Jan 1999 <nathan@acm.org> */
4 /* check range combining boolean operations work */
6 extern void abort();
8 #define N 77
10 void func(int i)
12 /* fold-const does some clever things with range tests. Make sure
13 we get (some of) them right */
15 /* these must fail, regardless of the value of i */
16 if ((i < 0) && (i >= 0))
17 abort();
18 if ((i > 0) && (i <= 0))
19 abort();
20 if ((i >= 0) && (i < 0))
21 abort();
22 if ((i <= 0) && (i > 0))
23 abort();
25 if ((i < N) && (i >= N))
26 abort();
27 if ((i > N) && (i <= N))
28 abort();
29 if ((i >= N) && (i < N))
30 abort();
31 if ((i <= N) && (i > N))
32 abort();
34 /* these must pass, regardless of the value of i */
35 if (! ((i < 0) || (i >= 0)))
36 abort();
37 if (! ((i > 0) || (i <= 0)))
38 abort();
39 if (! ((i >= 0) || (i < 0)))
40 abort();
41 if (! ((i <= 0) || (i > 0)))
42 abort();
44 if (! ((i < N) || (i >= N)))
45 abort();
46 if (! ((i > N) || (i <= N)))
47 abort();
48 if (! ((i >= N) || (i < N)))
49 abort();
50 if (! ((i <= N) || (i > N)))
51 abort();
53 return;
56 int main()
58 func(0);
59 func(1);
60 return 0;