summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr51879-17.c
blob: 806fe7b0f61a76934d27a39d207e5c1fc329b24a (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
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-pre" } */

struct S {
  int i;
};

extern struct S foo (void);
extern int foo2 (void);

struct S s, s2;

int bar (int c) {
  int r;

  if (c)
    {
      s = foo ();
      r = foo2 ();
    }
  else
    {
      s2 = foo ();
      r = foo2 ();
    }

  return r;
}

/* { dg-final { scan-tree-dump-times "foo \\(" 2 "pre"} } */
/* { dg-final { scan-tree-dump-times "foo2 \\(" 2 "pre"} } */
/* { dg-final { cleanup-tree-dump "pre" } } */