Skip to content

Commit d5b12a2

Browse files
authored
Rollup merge of #115174 - davidtwco:needs-test-bad-location-list-67992, r=wesleywiser
tests: add test for #67992 Fixes #67992. Just adding a regression test for this issue.
2 parents 2dfb67b + 0848ebd commit d5b12a2

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// compile-flags:-g
2+
3+
// === GDB TESTS ===================================================================================
4+
5+
// gdb-command:run
6+
7+
// gdb-command:print a
8+
// gdb-check:$1 = regression_bad_location_list_67992::Foo {x: [0 <repeats 1024 times>]}
9+
10+
// === LLDB TESTS ==================================================================================
11+
12+
// lldb-command:run
13+
// lldb-command:print a
14+
// lldbg-check:(regression_bad_location_list_67992::Foo) $0 = [...]
15+
// lldbr-check:(regression_bad_location_list_67992::Foo) a = [...]
16+
17+
const ARRAY_SIZE: usize = 1024;
18+
19+
struct Foo {
20+
x: [u64; ARRAY_SIZE],
21+
}
22+
23+
fn foo(a: Foo, i: usize) -> u64 {
24+
a.x[i] // #break
25+
}
26+
27+
fn main() {
28+
println!("Hello, world!");
29+
30+
println!("{}", foo(Foo { x: [0; ARRAY_SIZE] }, 42));
31+
}

0 commit comments

Comments
 (0)