Debian Codegraph @

gcc/testsuite/g++.dg/opt/cond1.C

raw
1 // { dg-do run }
2 // { dg-options "-O2" }
3
4 struct D { int x; };
5 struct W
6 {
7 W () {}
8 D & operator * () { return d; }
9 D d;
10 };
11
12 int
13 foo (int y)
14 {
15 W m;
16 (*m).x = (y > 1 ? y : 0);
17 return (*m).x;
18 }
19
20 int
21 main ()
22 {
23 return (foo (6) != 6);
24 }