PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / pr19431.c
blob2f656ceccbc2d052b649f9cf8e387efb878dfd04
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-optimized" } */
4 /* We want this optimized as
5 <bb 2>:
6 if (k != 0) goto <L2>; else goto <L3>;
8 <L3>:;
9 i1 = j1;
11 <L2>:;
12 return i1;
14 This requires that i1 and j1 are changed into registers after they
15 no longer have their address taken. */
17 int f(int k, int i1, int j1)
19 int *f1;
20 if(k)
21 f1 = &i1;
22 else
23 f1 = &j1;
24 return *f1;
27 /* { dg-final { scan-tree-dump "\[^\r\n\]*_. = PHI <i1_\[^,\]*, j1_\[^>\]*>" "optimized" } } */