Add new test to verify that the array index, limit, and stride are
[official-gcc.git] / gcc / testsuite / gcc.dg / builtin-unreachable-2.c
blob13bdb9f7395fc7077697ad190485427b3add48ef
1 /* Check that __builtin_unreachable() is a no-return function thus
2 causing the dead call to foo() to be removed. The comparison is
3 dead too, and should be removed. */
4 /* { dg-do compile } */
5 /* { dg-options "-O2 -fdump-tree-optimized -fdump-rtl-cse1" } */
6 void foo (void);
8 int
9 f (int i)
11 if (i > 1)
12 __builtin_unreachable();
13 if (i > 1)
14 foo ();
15 return 1;
17 /* { dg-final { scan-tree-dump-not "foo" "optimized" } } */
18 /* { dg-final { scan-rtl-dump-not "\\(if_then_else" "cse1" } } */
19 /* { dg-final { cleanup-tree-dump "optimized" } } */
20 /* { dg-final { cleanup-rtl-dump "cse1" } } */