Debian Codegraph @

gcc/testsuite/gcc.dg/debug/pr37616.c

raw
1 /* PR debug/37616 */
2 /* Test that one can put breakpoints onto continue, exitlab and break
3 and actually see program reaching those breakpoints.
4 This version of the test just checks that it can be compiled, linked
5 and executed, further testing is done in corresponding gcc.dg/dwarf2/
6 test and hopefully in gdb testsuite. */
7 /* { dg-do run } */
8 /* { dg-options "-O0 -g -dA" } */
9
10 extern void abort (void);
11
12 int
13 foo (int parm)
14 {
15 int varj, varm;
16
17 for (varj = 0; varj < 10; varj++)
18 {
19 if (varj == 5)
20 continue;
21 if (varj == 7 && !parm)
22 goto exitlab;
23 if (varj == 9)
24 break;
25 varm = varj;
26 }
27
28 exitlab:
29 return varm;
30 }
31
32 int
33 main (void)
34 {
35 if (foo (0) != 6)
36 abort ();
37 if (foo (1) != 8)
38 abort ();
39 return 0;
40 }