Skip to content

Commit a288e8c

Browse files
authored
Rollup merge of rust-lang#155897 - wesleywiser:test_83060, r=jieyouxu
Add regression test for LLVM bug with huge stack frames Regression test for rust-lang#83060 Closes rust-lang#83060
2 parents fe51696 + 88922e3 commit a288e8c

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

tests/ui/codegen/huge-stacks.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//@ revisions: unoptimized optimized
2+
//@[optimized]compile-flags: -O
3+
//@ run-pass
4+
//@ only-64bit
5+
//@ min-llvm-version: 22
6+
7+
// Regression test for https://github.com/rust-lang/rust/issues/83060
8+
9+
fn func() {
10+
const CAP: usize = std::u32::MAX as usize;
11+
let mut x: [u8; CAP] = [0; CAP];
12+
x[2] = 123;
13+
assert_eq!(x[2], 123);
14+
}
15+
16+
fn main() {
17+
std::thread::Builder::new()
18+
.stack_size(5 * 1024 * 1024 * 1024)
19+
.spawn(func)
20+
.unwrap()
21+
.join()
22+
.unwrap();
23+
}

0 commit comments

Comments
 (0)