blob: 19183d6cc15deedab66880d11c23d01d997bedc6 [file] [log] [blame]
Vedant Kumarb572f642018-07-26 20:56:53 +00001// 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
9struct A {
10 int a;
11 A(int a) : a(a) {}
12};
13
14using log_t = std::deque<A>;
15
16static void __attribute__((noinline, optnone)) escape(log_t &log) {
17 static volatile log_t *sink;
18 sink = &log;
19}
20
21int main() {
22 log_t log;
23 log.emplace_back(1234);
24 log.emplace_back(56789);
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