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