aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/pr119599-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/torture/pr119599-1.c')
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr119599-1.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/torture/pr119599-1.c b/gcc/testsuite/gcc.dg/torture/pr119599-1.c
new file mode 100644
index 0000000..4fbd228
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr119599-1.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-einline" } */
+
+/* PR ipa/119599 */
+/* inlining a noreturn function which returns
+ can cause an ICE when dealing finding an unreachable block.
+ We should get a __builtin_unreachable after the inliing. */
+
+
+void baz (void);
+
+static inline __attribute__((always_inline, noreturn)) void
+bar (void)
+{
+ static volatile int t = 0;
+ if (t == 0)
+ baz ();
+} /* { dg-warning "function does return" } */
+
+void
+foo (void)
+{
+ bar ();
+}
+
+/* After inlining, we should have call to __builtin_unreachable now. */
+/* { dg-final { scan-tree-dump "__builtin_unreachable " "einline" } } */