gcc/testsuite/g++.dg/opt/pr94618.C
raw| 1 | // PR rtl-optimization/94618 |
| 2 | // { dg-do compile { target c++11 } } |
| 3 | // { dg-options "-O2 -fnon-call-exceptions -fcompare-debug" } |
| 4 | |
| 5 | struct S |
| 6 | { |
| 7 | int a, b, c; |
| 8 | int foo () noexcept { return a; } |
| 9 | int bar () noexcept { return b; } |
| 10 | void baz (int); |
| 11 | void qux () { if (c) for (int x = foo (); x != bar (); ) baz (x); } |
| 12 | }; |
| 13 | |
| 14 | struct T |
| 15 | { |
| 16 | S s; |
| 17 | void foo (); |
| 18 | }; |
| 19 | |
| 20 | void |
| 21 | T::foo () |
| 22 | { |
| 23 | s.qux (); |
| 24 | s.qux (); |
| 25 | } |