diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/debug/pr37616.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/debug/pr37616.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/debug/pr37616.c b/gcc/testsuite/gcc.dg/debug/pr37616.c new file mode 100644 index 000000000..3bbaebbdf --- /dev/null +++ b/gcc/testsuite/gcc.dg/debug/pr37616.c @@ -0,0 +1,40 @@ +/* PR debug/37616 */ +/* Test that one can put breakpoints onto continue, exitlab and break + and actually see program reaching those breakpoints. + This version of the test just checks that it can be compiled, linked + and executed, further testing is done in corresponding gcc.dg/dwarf2/ + test and hopefully in gdb testsuite. */ +/* { dg-do run } */ +/* { dg-options "-O0 -g -dA" } */ + +extern void abort (void); + +int +foo (int parm) +{ + int varj, varm; + + for (varj = 0; varj < 10; varj++) + { + if (varj == 5) + continue; + if (varj == 7 && !parm) + goto exitlab; + if (varj == 9) + break; + varm = varj; + } + +exitlab: + return varm; +} + +int +main (void) +{ + if (foo (0) != 6) + abort (); + if (foo (1) != 8) + abort (); + return 0; +} |