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
foo(void)13 foo (void)
14 {
15   return 0 ^ x;
16 }
17 
18 int
bar(void)19 bar (void)
20 {
21   return 1 ^ x;
22 }
23 
24 int
baz(void)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
main(void)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 }
54