about summary refs log tree commit diff
path: root/tests/ui/runtime
diff options
context:
space:
mode:
authorKivooeo <Kivooeo123@gmail.com>2025-06-07 16:17:21 +0500
committerKivooeo <Kivooeo123@gmail.com>2025-06-08 11:25:09 +0500
commit85ce9ee481a56bcabaa9480cfc0e2b420e4f1807 (patch)
tree546842f643a74977c32a405980899c37e7737def /tests/ui/runtime
parentc57119b9a1c86968188bb9703a7859c17f8bc71c (diff)
downloadrust-85ce9ee481a56bcabaa9480cfc0e2b420e4f1807.tar.gz
rust-85ce9ee481a56bcabaa9480cfc0e2b420e4f1807.zip
cleaned up some tests
Diffstat (limited to 'tests/ui/runtime')
-rw-r--r--tests/ui/runtime/deep_recursion.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/ui/runtime/deep_recursion.rs b/tests/ui/runtime/deep_recursion.rs
new file mode 100644
index 00000000000..bf220f174a1
--- /dev/null
+++ b/tests/ui/runtime/deep_recursion.rs
@@ -0,0 +1,10 @@
+//! Checks deep recursion behavior.
+
+//@ run-pass
+//@ ignore-emscripten apparently blows the stack
+
+fn f(x: isize) -> isize {
+    if x == 1 { return 1; } else { let y: isize = 1 + f(x - 1); return y; }
+}
+
+pub fn main() { assert_eq!(f(5000), 5000); }