PR testsuite/52641
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / pr19431.c
blob08972063e0d5df8c57c903d0aea1092f71b254cd
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" } } */
28 /* { dg-final { cleanup-tree-dump "optimized" } } */