* gcc.dg/stack-check-5.c: Skip with -fstack-protector.
[official-gcc.git] / gcc / testsuite / gcc.dg / pr66299-3.c
blobffee04972a0eeea5b06d06941d7cadf55cfffa63
1 /* PR tree-optimization/66299 */
2 /* { dg-do run } */
3 /* { dg-options "-fdump-tree-original" } */
5 void __attribute__ ((noinline, noclone))
6 test1 (int x)
8 if ((2 << x) == 1
9 || (8 << x) == 1
10 || (8 << x) == 2
11 || (3072 << x) == 3
12 || (294912 << x) == 9
13 || (45056 << x) == 11
14 || (2176 << x) == 17)
15 __builtin_abort ();
18 void __attribute__ ((noinline, noclone))
19 test2 (int x)
21 if ((2 << x) != 1
22 && (8 << x) != 1
23 && (8 << x) != 2
24 && (3072 << x) != 3
25 && (294912 << x) != 9
26 && (45056 << x) != 11
27 && (2176 << x) != 17)
29 else
30 __builtin_abort ();
33 void __attribute__ ((noinline, noclone))
34 test3 (int x)
36 if ((3 << x) == 4
37 || (1 << x) == 12
38 || (40 << x) == 1024
39 || (2 << x) == 84
40 || (3 << x) == 16384
41 || (10 << x) == 6144)
42 __builtin_abort ();
45 void __attribute__ ((noinline, noclone))
46 test4 (int x)
48 if ((3 << x) != 4
49 && (1 << x) != 12
50 && (40 << x) != 1024
51 && (2 << x) != 84
52 && (3 << x) != 16384
53 && (10 << x) != 6144)
55 else
56 __builtin_abort ();
59 int
60 main (void)
62 test1 (0);
63 test2 (1);
64 test3 (1);
65 test4 (2);
68 /* { dg-final { scan-tree-dump-not "(<<|==|!=)" "original" } } */