blob: b919a291eba2c93d57f9fe82abb13840ccd529f6 [file] [log] [blame]
Adrian Prantla0de3a82017-12-07 19:40:311// RUN: %clang -fblocks %target_itanium_abi_host_triple -arch x86_64 %s -o %t.out -g -fsanitize=address
Reid Klecknera6fc06b2017-08-31 18:16:552// RUN: %test_debuginfo %s %t.out
3// FIXME: Remove system-darwin when we build BlocksRuntime everywhere.
4// REQUIRES: not_asan, system-darwin
5// Zorg configures the ASAN stage2 bots to not build the asan
6// compiler-rt. Only run this test on non-asanified configurations.
7void b();
8struct S {
9 int a[8];
10};
11
12int f(struct S s, unsigned i) {
13 // DEBUGGER: break 17
14 // DEBUGGER: r
15 // DEBUGGER: p s
16 // CHECK: a = ([0] = 0, [1] = 1, [2] = 2, [3] = 3, [4] = 4, [5] = 5, [6] = 6, [7] = 7)
17 return s.a[i];
18}
19
20int main(int argc, const char **argv) {
21 struct S s = {{0, 1, 2, 3, 4, 5, 6, 7}};
22 if (f(s, 4) == 4) {
23 // DEBUGGER: break 27
24 // DEBUGGER: c
25 // DEBUGGER: p s
26 // CHECK: a = ([0] = 0, [1] = 1, [2] = 2, [3] = 3, [4] = 4, [5] = 5, [6] = 6, [7] = 7)
27 b();
28 }
29 return 0;
30}
31
32void c() {}
33
34void b() {
35 // DEBUGGER: break 40
36 // DEBUGGER: c
37 // DEBUGGER: p x
38 // CHECK: 42
39 __block int x = 42;
40 c();
41}