gcc/gcc/testsuite/gcc.dg/builtin-unreachable-1.c

18 lines
308 B
C

/* 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();
}
}