summaryrefslogtreecommitdiffstats
path: root/tests/debuginfo/regression-bad-location-list-67992.rs
blob: cc7c4a0d71a34e31ea247378f1b46634eaea15b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// compile-flags:-g

// === GDB TESTS ===================================================================================

// gdb-command:run

// gdb-command:print a
// gdb-check:$1 = regression_bad_location_list_67992::Foo {x: [0 <repeats 1024 times>]}

// === LLDB TESTS ==================================================================================

// lldb-command:run
// lldb-command:print a
// lldbg-check:(regression_bad_location_list_67992::Foo) $0 = [...]
// lldbr-check:(regression_bad_location_list_67992::Foo) a = [...]

const ARRAY_SIZE: usize = 1024;

struct Foo {
    x: [u64; ARRAY_SIZE],
}

fn foo(a: Foo, i: usize) -> u64 {
    a.x[i] // #break
}

fn main() {
    println!("Hello, world!");

    println!("{}", foo(Foo { x: [0; ARRAY_SIZE] }, 42));
}