Vedant Kumar | b572f64 | 2018-07-26 20:56:53 +0000 | [diff] [blame] | 1 | // RUN: %clangxx -arch x86_64 %target_itanium_abi_host_triple -O1 -g %s -o %t.out -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. |
| 6 | |
| 7 | #include <deque> |
| 8 | |
| 9 | struct A { |
| 10 | int a; |
| 11 | A(int a) : a(a) {} |
| 12 | }; |
| 13 | |
| 14 | using log_t = std::deque<A>; |
| 15 | |
| 16 | static void __attribute__((noinline, optnone)) escape(log_t &log) { |
| 17 | static volatile log_t *sink; |
| 18 | sink = &log; |
| 19 | } |
| 20 | |
| 21 | int main() { |
| 22 | log_t log; |
Tim Northover | c5018d4 | 2018-07-31 13:19:01 +0000 | [diff] [blame^] | 23 | log.push_back(1234); |
| 24 | log.push_back(56789); |
Vedant Kumar | b572f64 | 2018-07-26 20:56:53 +0000 | [diff] [blame] | 25 | escape(log); |
| 26 | // DEBUGGER: break 25 |
| 27 | while (!log.empty()) { |
| 28 | auto record = log.front(); |
| 29 | log.pop_front(); |
| 30 | escape(log); |
| 31 | // DEBUGGER: break 30 |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | // DEBUGGER: r |
| 36 | |
| 37 | // (at line 25) |
| 38 | // DEBUGGER: p log |
| 39 | // CHECK: 1234 |
| 40 | // CHECK: 56789 |
| 41 | |
| 42 | // DEBUGGER: c |
| 43 | |
| 44 | // (at line 30) |
| 45 | // DEBUGGER: p log |
| 46 | // CHECK: 56789 |