gcc/testsuite/g++.dg/debug/pr46338.C
raw| 1 | // PR debug/46338 |
| 2 | // { dg-do compile } |
| 3 | // { dg-require-profiling "-fprofile-generate" } |
| 4 | // { dg-options "-O -fprofile-generate -fcompare-debug" } |
| 5 | |
| 6 | void bar (); |
| 7 | |
| 8 | struct S |
| 9 | { |
| 10 | int f () |
| 11 | { |
| 12 | return 0; |
| 13 | } |
| 14 | }; |
| 15 | |
| 16 | S *s; |
| 17 | |
| 18 | void |
| 19 | foo (int x) |
| 20 | { |
| 21 | if (x) |
| 22 | return; |
| 23 | bar (); |
| 24 | for (int j = 0; j < s->f (); j++) |
| 25 | ; |
| 26 | } |