diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/Wunreachable-7.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/Wunreachable-7.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/Wunreachable-7.c b/gcc/testsuite/gcc.dg/Wunreachable-7.c new file mode 100644 index 00000000000..a19c94a1760 --- /dev/null +++ b/gcc/testsuite/gcc.dg/Wunreachable-7.c @@ -0,0 +1,18 @@ +/* PR c/11370 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -Wunreachable-code" } */ + +int main(int argc, char *argv[]) +{ + if (argc != 1) + exit(1); + + { + int ix; /* { dg-bogus "will never be executed" } */ + ix = printf("hello\n"); + printf("%d\n", ix); + } + + return 0; +} + |