libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / pr108359.c
blob7cf04f7413286e86e21261d18e9e8ae686c18aa5
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-optimized" } */
4 /* PR test case. */
5 int b = 10;
6 int c;
7 char e;
8 void foo();
9 static char(a)(char f, char g) { return f && g == 1 ? 0 : f % g; }
10 short(d)(short f, short g) { return f * g; }
11 int main() {
12 short h;
13 int i;
14 unsigned j;
15 h = d(b && c, 5);
16 j = h;
17 i = a(h, 237);
18 unsigned k = i;
19 e = i < 0 || k >= 32 ? 0 : i >> k;
20 if (e) {
21 c = 0;
22 foo();
27 /* Also Check that small ranges are broken down and optimized properly
28 This function should never call foo (). */
30 int otherfunc (int x, int z) {
31 if (x < 1 || x > 6 )
32 return 0;
34 if (x == z)
36 if (x >> z > 0)
37 foo ();
38 if (x * z > 26 && x * z < 35)
39 foo ();
40 if (x + z == 5)
41 foo ();
42 if ((x + z) % 2 == 1)
43 foo ();
44 if (x / z != 1)
45 foo ();
48 return 0;
52 /* { dg-final { scan-tree-dump-not "foo" "optimized" } } */