2018-11-07 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / g++.dg / opt / pr50682.C
blobb7e91f45d73dff5edfffad6bdde44370b44c01c0
1 // PR tree-optimization/50682
2 // { dg-do compile }
3 // { dg-options "-O2 -fnon-call-exceptions -ftracer -fno-tree-ccp -fno-tree-copy-prop -fno-tree-dce" }
5 void foo () __attribute__ ((__noreturn__));
6 int baz ();
8 const int &
9 bar (const int &x, const int &y)
11   if (x >= y)
12     return y;
13   return x;
16 int a, b;
18 struct S
20   ~S ();
21   bool m ()
22   {
23     int l = bar (a, b);
24     int r = baz ();
25     if (r)
26         r = l;
27       return r;
28   }
31 void
32 test ()
34   S s;
35   if (!s.m ())
36     foo ();
37   if (!s.m ())
38     foo ();