Debian Codegraph @

gcc/testsuite/gcc.dg/debug/pr29609-2.c

raw
1 /* PR debug/29609 */
2 /* Verify that breakpoint on both goto failure; stmts is hit.
3 This version of the test just checks that it can be compiled, linked
4 and executed, further testing is done in corresponding gcc.dg/dwarf2/
5 test and hopefully in gdb testsuite. */
6 /* { dg-do run } */
7 /* { dg-options "-O0 -g -dA" } */
8
9 extern void abort (void);
10 int x;
11
12 int
13 foo (void)
14 {
15 return 0 ^ x;
16 }
17
18 int
19 bar (void)
20 {
21 return 1 ^ x;
22 }
23
24 int
25 baz (void)
26 {
27 int c;
28
29 if (!foo ())
30 goto failure;
31
32 if (!bar ())
33 goto failure;
34
35 return 0;
36
37 failure:
38 return 1;
39 }
40
41 int
42 main (void)
43 {
44 if (baz () != 1)
45 abort ();
46 x = 1;
47 if (baz () != 1)
48 abort ();
49 x = 2;
50 if (baz () != 0)
51 abort ();
52 return 0;
53 }