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. |
| 7 | // |
| 8 | // DEBUGGER: break 19 |
| 9 | // DEBUGGER: r |
| 10 | // DEBUGGER: p s |
| 11 | // |
| 12 | // CHECK: a = ([0] = 0, [1] = 1, [2] = 2, [3] = 3, [4] = 4, [5] = 5, [6] = 6, [7] = 7) |
| 13 | |
| 14 | struct S { |
| 15 | int a[8]; |
| 16 | }; |
| 17 | |
| 18 | int f(struct S s, unsigned i) { |
| 19 | return s.a[i]; |
| 20 | } |
| 21 | |
| 22 | int main(int argc, const char **argv) { |
| 23 | struct S s = {{0, 1, 2, 3, 4, 5, 6, 7}}; |
| 24 | return f(s, 4); |
| 25 | } |