summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/debug/dwarf2/pr29609-2.c
blob: 43bc54524a999ffa4d8753df250d44462fb0f8e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/* PR debug/29609 */
/* Verify that breakpoint on both goto failure; stmts is hit.  */
/* { dg-do compile } */
/* { dg-options "-O0 -gdwarf-2 -dA" } */

extern void abort (void);
int x;

int
foo (void)
{
  return 0 ^ x;
}

int
bar (void)
{
  return 1 ^ x;
}

int
baz (void)
{
  int c;

  if (!foo ())
    goto failure;

  if (!bar ())
    goto failure;

  return 0;

failure:
  return 1;
}

int
main (void)
{
  if (baz () != 1)
    abort ();
  x = 1;
  if (baz () != 1)
    abort ();
  x = 2;
  if (baz () != 0)
    abort ();
  return 0;
}

/* { dg-final { scan-assembler "pr29609-2.c:27" } } */
/* { dg-final { scan-assembler "pr29609-2.c:30" } } */