1 /* PR tree-optimization/56098 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -fhoist-adjacent-loads -fdump-tree-optimized" } */
4 
5 struct S { volatile int i; volatile int j; };
6 
7 int
bar(struct S * x,int y)8 bar (struct S *x, int y)
9 {
10   int r;
11   if (y)
12     r = x->i;
13   else
14     r = x->j;
15   return r;
16 }
17 
18 /* { dg-final { scan-tree-dump-not "r_\[0-9]* =.v. \[^\n\r]*;\[\n\r]*  r_\[0-9]* =.v. " "optimized" } } */
19