aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/CBackend/2002-05-21-MissingReturn.ll15
-rw-r--r--test/CodeGen/CBackend/2002-05-21-MissingReturn.ll15
2 files changed, 30 insertions, 0 deletions
diff --git a/test/CBackend/2002-05-21-MissingReturn.ll b/test/CBackend/2002-05-21-MissingReturn.ll
new file mode 100644
index 0000000000..2fd3e27faf
--- /dev/null
+++ b/test/CBackend/2002-05-21-MissingReturn.ll
@@ -0,0 +1,15 @@
+; This case was emitting code that looked like this:
+; ...
+; llvm_BB1: /* no statement here */
+; }
+;
+; Which the Sun C compiler rejected, so now we are sure to put a return
+; instruction in there if the basic block is otherwise empty.
+;
+void "test"() {
+ br label %BB1
+BB2:
+ br label %BB2
+BB1:
+ ret void
+}
diff --git a/test/CodeGen/CBackend/2002-05-21-MissingReturn.ll b/test/CodeGen/CBackend/2002-05-21-MissingReturn.ll
new file mode 100644
index 0000000000..2fd3e27faf
--- /dev/null
+++ b/test/CodeGen/CBackend/2002-05-21-MissingReturn.ll
@@ -0,0 +1,15 @@
+; This case was emitting code that looked like this:
+; ...
+; llvm_BB1: /* no statement here */
+; }
+;
+; Which the Sun C compiler rejected, so now we are sure to put a return
+; instruction in there if the basic block is otherwise empty.
+;
+void "test"() {
+ br label %BB1
+BB2:
+ br label %BB2
+BB1:
+ ret void
+}