summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/CodeGen')
-rw-r--r--clang/test/CodeGen/unreachable.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/clang/test/CodeGen/unreachable.c b/clang/test/CodeGen/unreachable.c
new file mode 100644
index 00000000000..ab029b613da
--- /dev/null
+++ b/clang/test/CodeGen/unreachable.c
@@ -0,0 +1,26 @@
+// RUN: clang-cc -emit-llvm -o %t %s &&
+// RUN: grep '@unreachable' %t | count 0
+
+extern int unreachable();
+
+int f0() {
+ return 0;
+ unreachable();
+}
+
+int f1(int i) {
+ goto L0;
+ int a = unreachable();
+ L0:
+ return 0;
+}
+
+int f2(int i) {
+ goto L0;
+ unreachable();
+ int a;
+ unreachable();
+ L0:
+ a = i + 1;
+ return a;
+}
OpenPOWER on IntegriCloud