Adrian Prantl | 7b2bf89 | 2017-04-17 17:57:03 +0000 | [diff] [blame] | 1 | // RUN: %clang %target_itanium_abi_host_triple -arch x86_64 %s -o %t.out -g -fsanitize=safe-stack |
| 2 | // RUN: %test_debuginfo %s %t.out |
| 3 | // REQUIRES: not_asan |
| 4 | // Zorg configures the ASAN stage2 bots to not build the |
| 5 | // safestack compiler-rt. Only run this test on |
| 6 | // non-asanified configurations. |
Adrian Prantl | 7b2bf89 | 2017-04-17 17:57:03 +0000 | [diff] [blame] | 7 | |
| 8 | struct S { |
| 9 | int a[8]; |
| 10 | }; |
| 11 | |
Adrian Prantl | 18c18de | 2017-04-17 17:57:05 +0000 | [diff] [blame^] | 12 | int f(struct S s, unsigned i); |
Adrian Prantl | 7b2bf89 | 2017-04-17 17:57:03 +0000 | [diff] [blame] | 13 | |
| 14 | int main(int argc, const char **argv) { |
| 15 | struct S s = {{0, 1, 2, 3, 4, 5, 6, 7}}; |
Adrian Prantl | 18c18de | 2017-04-17 17:57:05 +0000 | [diff] [blame^] | 16 | // DEBUGGER: break 17 |
| 17 | f(s, 4); |
| 18 | // DEBUGGER: break 19 |
| 19 | return 0; |
Adrian Prantl | 7b2bf89 | 2017-04-17 17:57:03 +0000 | [diff] [blame] | 20 | } |
Adrian Prantl | 18c18de | 2017-04-17 17:57:05 +0000 | [diff] [blame^] | 21 | |
| 22 | int f(struct S s, unsigned i) { |
| 23 | // DEBUGGER: break 24 |
| 24 | return s.a[i]; |
| 25 | } |
| 26 | |
| 27 | // DEBUGGER: r |
| 28 | // DEBUGGER: p s |
| 29 | // CHECK: a = ([0] = 0, [1] = 1, [2] = 2, [3] = 3, [4] = 4, [5] = 5, [6] = 6, [7] = 7) |
| 30 | // DEBUGGER: c |
| 31 | // DEBUGGER: p s |
| 32 | // CHECK: a = ([0] = 0, [1] = 1, [2] = 2, [3] = 3, [4] = 4, [5] = 5, [6] = 6, [7] = 7) |
| 33 | // DEBUGGER: c |
| 34 | // DEBUGGER: p s |
| 35 | // CHECK: a = ([0] = 0, [1] = 1, [2] = 2, [3] = 3, [4] = 4, [5] = 5, [6] = 6, [7] = 7) |