blob: 1407e01ed6b404c9b035af578121abea9eb7c753 [file] [log] [blame]
Adrian Prantl67caa192017-04-17 17:56:591// RUN: %clang %target_itanium_abi_host_triple -arch x86_64 %s -o %t.out -g -fsanitize=address
2// RUN: %test_debuginfo %s %t.out
3// REQUIRES: not_asan
4// Zorg configures the ASAN stage2 bots to not build the asan
5// compiler-rt. Only run this test on non-asanified configurations.
Adrian Prantlc26059f2017-04-17 17:57:016void b();
Adrian Prantl67caa192017-04-17 17:56:597struct S {
8 int a[8];
9};
10
11int f(struct S s, unsigned i) {
Adrian Prantlc26059f2017-04-17 17:57:0112 // DEBUGGER: break 16
13 // DEBUGGER: r
14 // DEBUGGER: p s
15 // CHECK: a = ([0] = 0, [1] = 1, [2] = 2, [3] = 3, [4] = 4, [5] = 5, [6] = 6, [7] = 7)
Adrian Prantl67caa192017-04-17 17:56:5916 return s.a[i];
17}
18
19int main(int argc, const char **argv) {
20 struct S s = {{0, 1, 2, 3, 4, 5, 6, 7}};
Adrian Prantlc26059f2017-04-17 17:57:0121 if (f(s, 4) == 4) {
22 // DEBUGGER: break 26
23 // DEBUGGER: c
24 // DEBUGGER: p s
25 // CHECK: a = ([0] = 0, [1] = 1, [2] = 2, [3] = 3, [4] = 4, [5] = 5, [6] = 6, [7] = 7)
26 b();
27 }
Adrian Prantl67caa192017-04-17 17:56:5928 return 0;
29}
Adrian Prantlc26059f2017-04-17 17:57:0130
31void c() {}
32
33void b() {
34 // DEBUGGER: break 39
35 // DEBUGGER: c
36 // DEBUGGER: p x
37 // CHECK: 42
38 __block int x = 42;
39 c();
40}