Adrian Prantl | 67caa19 | 2017-04-17 17:56:59 | [diff] [blame] | 1 | // 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 Prantl | c26059f | 2017-04-17 17:57:01 | [diff] [blame] | 6 | void b(); |
Adrian Prantl | 67caa19 | 2017-04-17 17:56:59 | [diff] [blame] | 7 | struct S { |
| 8 | int a[8]; |
| 9 | }; |
| 10 | |
| 11 | int f(struct S s, unsigned i) { |
Adrian Prantl | c26059f | 2017-04-17 17:57:01 | [diff] [blame] | 12 | // 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 Prantl | 67caa19 | 2017-04-17 17:56:59 | [diff] [blame] | 16 | return s.a[i]; |
| 17 | } |
| 18 | |
| 19 | int main(int argc, const char **argv) { |
| 20 | struct S s = {{0, 1, 2, 3, 4, 5, 6, 7}}; |
Adrian Prantl | c26059f | 2017-04-17 17:57:01 | [diff] [blame] | 21 | 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 Prantl | 67caa19 | 2017-04-17 17:56:59 | [diff] [blame] | 28 | return 0; |
| 29 | } |
Adrian Prantl | c26059f | 2017-04-17 17:57:01 | [diff] [blame] | 30 | |
| 31 | void c() {} |
| 32 | |
| 33 | void b() { |
| 34 | // DEBUGGER: break 39 |
| 35 | // DEBUGGER: c |
| 36 | // DEBUGGER: p x |
| 37 | // CHECK: 42 |
| 38 | __block int x = 42; |
| 39 | c(); |
| 40 | } |