aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/builtin-unreachable-1.c
blob: 165da3f944c9694dd449071d4c30b6e600fbd85a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* Check that __builtin_unreachable() prevents the 'control reaches
   end of non-void function' diagnostic.  */
/* { dg-do compile } */
/* { dg-options "-O2 -Wreturn-type" } */
int
f(int a, int b)
{
  if (a)
    {
      return b;
    }
  else
    {
      asm ("bug");
      __builtin_unreachable();
    }
}