summaryrefslogtreecommitdiffstats
path: root/tests/ui/mir/mir_heavy_promoted.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/mir/mir_heavy_promoted.rs')
-rw-r--r--tests/ui/mir/mir_heavy_promoted.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/ui/mir/mir_heavy_promoted.rs b/tests/ui/mir/mir_heavy_promoted.rs
new file mode 100644
index 000000000..092299880
--- /dev/null
+++ b/tests/ui/mir/mir_heavy_promoted.rs
@@ -0,0 +1,11 @@
+// run-pass
+// ignore-emscripten apparently only works in optimized mode
+
+const TEST_DATA: [u8; 32 * 1024 * 1024] = [42; 32 * 1024 * 1024];
+
+// Check that the promoted copy of TEST_DATA doesn't
+// leave an alloca from an unused temp behind, which,
+// without optimizations, can still blow the stack.
+fn main() {
+ println!("{}", TEST_DATA.len());
+}