libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / phi-opt-value-2.c
blob809ccfe1479e4d5e07531063e07d2843cd361c39
1 /* { dg-do compile } */
2 /* Phi-OPT should be able to optimize this without sinking being invoked. */
3 /* { dg-options "-O -fdump-tree-phiopt2 -fdump-tree-optimized -fno-tree-sink" } */
5 int f(int a, int b, int c) {
6 int d = a + b;
7 if (c > 5) return c;
8 if (a == 0) return b;
9 return d;
12 unsigned rot(unsigned x, int n) {
13 const int bits = __CHAR_BIT__ * __SIZEOF_INT__;
14 int t = ((x << n) | (x >> (bits - n)));
15 return (n == 0) ? x : t;
18 /* { dg-final { scan-tree-dump-times "goto" 2 "phiopt2" } } */
19 /* { dg-final { scan-tree-dump-times "goto" 2 "optimized" } } */