summaryrefslogtreecommitdiffstats
path: root/test/CodeGen/unreachable-ret.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen/unreachable-ret.c')
-rw-r--r--test/CodeGen/unreachable-ret.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/CodeGen/unreachable-ret.c b/test/CodeGen/unreachable-ret.c
new file mode 100644
index 0000000000..386b83e9ef
--- /dev/null
+++ b/test/CodeGen/unreachable-ret.c
@@ -0,0 +1,23 @@
+// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s
+
+extern void abort() __attribute__((noreturn));
+
+void f1() {
+ abort();
+}
+// CHECK-LABEL: define {{.*}}void @f1()
+// CHECK-NEXT: entry:
+// CHECK-NEXT: call void @abort()
+// CHECK-NEXT: unreachable
+// CHECK-NEXT: }
+
+void *f2() {
+ abort();
+ return 0;
+}
+// CHECK-LABEL: define {{.*}}i8* @f2()
+// CHECK-NEXT: entry:
+// CHECK-NEXT: call void @abort()
+// CHECK-NEXT: unreachable
+// CHECK-NEXT: }
+