• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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: !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 // UNSUPPORTED: apple-lldb-pre-1000
7 #include <deque>
8 
9 struct A {
10   int a;
AA11   A(int a) : a(a) {}
12 };
13 
14 using log_t = std::deque<A>;
15 
escape(log_t & log)16 static void __attribute__((noinline, optnone)) escape(log_t &log) {
17   static volatile log_t *sink;
18   sink = &log;
19 }
20 
main()21 int main() {
22   log_t log;
23   log.push_back(1234);
24   log.push_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
47