aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/debug/debug-3.c
blob: e2b7a4b1803fce3be226e051e9c009d3b89200ff (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
/* This testcase failed, because scope containing baz was deleted
   (spanned 0 basic blocks) and DWARF-2 couldn't find baz origin.  */
/* { dg-do compile } */
/* { dg-require-effective-target trampolines } */

struct A { char *a, *b, *c, *d; };

static int
bar (struct A *x)
{
  return x->c - x->b;
}

void fnptr (void (*fn) (void));

void
foo (void)
{
  struct A e;

  {
    void baz (void)
      {
	bar (&e);
      }
    fnptr (baz);
  }
  {
    struct A *f;

    f = &e;
    if (f->c - f->a > f->d - f->a)
      f->c = f->d;
  }
}