Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/gcc.dg/noreturn-7.c @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
line wrap: on
line source
/* PR optimization/13394 */ /* Origin: Carlo Wood <carlo@gcc.gnu.org> */ /* Verify that a bogus "function does return" warning is not issued in presence of tail recursion within a noreturn function. */ /* { dg-do compile } */ /* { dg-options "-O2 -Wreturn-type -Wmissing-noreturn -fno-ipa-icf" } */ void f(void) __attribute__ ((__noreturn__)); void _exit(int status) __attribute__ ((__noreturn__)); int z = 0; void g() /* { dg-warning "might be candidate" } */ { if (++z > 10) _exit(0); g(); } void f() { if (++z > 10) _exit(0); f(); } /* { dg-bogus "does return" } */ int h() /* { dg-warning "might be candidate" } */ { if (++z > 10) _exit(0); return h(); } /* { dg-bogus "end of non-void function" } */ int k() /* { dg-warning "might be candidate" } */ { if (++z > 10) _exit(0); k(); } /* { dg-warning "control reaches" } */