summaryrefslogtreecommitdiffstats
path: root/tests/codegen/non-terminate/infinite-recursion.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/codegen/non-terminate/infinite-recursion.rs')
-rw-r--r--tests/codegen/non-terminate/infinite-recursion.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/codegen/non-terminate/infinite-recursion.rs b/tests/codegen/non-terminate/infinite-recursion.rs
new file mode 100644
index 000000000..6d1f2d4bf
--- /dev/null
+++ b/tests/codegen/non-terminate/infinite-recursion.rs
@@ -0,0 +1,14 @@
+// compile-flags: -C opt-level=3
+
+#![crate_type = "lib"]
+
+#![allow(unconditional_recursion)]
+
+// CHECK-LABEL: @infinite_recursion
+#[no_mangle]
+fn infinite_recursion() -> u8 {
+ // CHECK-NOT: ret i8 undef
+ // CHECK: br label %{{.+}}
+ // CHECK-NOT: ret i8 undef
+ infinite_recursion()
+}