libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / graphite / run-id-pr114041-2.c
blobc935255fe8ffa7225de721f33c1a3a7fb4764dd2
1 /* PR tree-optimization/114041 */
2 /* { dg-options "-O -fgraphite-identity" } */
4 unsigned a[24], b[24];
5 enum E { E0 = 0, E1 = 1, E42 = 42, E56 = 56 };
7 __attribute__((noipa)) unsigned
8 foo (enum E x)
10 for (int i = 0; i < 24; ++i)
11 a[i] = i;
12 unsigned e;
13 if (x >= E42)
14 e = __builtin_clz ((unsigned) x);
15 else
16 e = 42;
17 for (int i = 0; i < 24; ++i)
18 b[i] = i;
19 return e;
22 int
23 main ()
25 if (foo (E1) != 42 || foo (E56) != __SIZEOF_INT__ * __CHAR_BIT__ - 6)
26 __builtin_abort ();