aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/pr55094.c
blob: c445b1a8649206c0fb849ebd093814e9b86ff3a8 (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
/* PR middle-end/55094 */
/* { dg-do compile } */
/* { dg-options "-fcompare-debug -Os" } */
/* { dg-additional-options "-fomit-frame-pointer -fno-asynchronous-unwind-tables -mpreferred-stack-boundary=2" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */

extern int fn (long);
int v;

int
foo (int x, long *y)
{
  if (x)
    {
      fn (y[0]);
      __builtin_trap ();
    }
  __builtin_trap ();
}

int
bar (int x, long *y)
{
  if (x)
    {
      fn (y[0]);
      v = 1;
      __builtin_unreachable ();
    }
  v = 1;
  __builtin_unreachable ();
}

int
baz (int x, long *y)
{
  if (x)
    {
      fn (y[0]);
      v = 1;
      __builtin_unreachable ();
    }
  v = 1;
  int w = 1;
  __builtin_unreachable ();
}