brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · d807fa1 Raw
48 lines · cpp
1// REQUIRES: !asan, compiler-rt, lldb2// UNSUPPORTED: system-windows3//           Zorg configures the ASAN stage2 bots to not build the asan4//           compiler-rt. Only run this test on non-asanified configurations.5// UNSUPPORTED: apple-lldb-pre-10006 7// XFAIL: lldb8// lldb-8, even outside of dexter, will sometimes trigger an asan fault in9// the debugged process and generally freak out.10 11// RUN: %clang++ -std=gnu++11 -O1 -glldb -fsanitize=address -arch x86_64 %s -o %t12// RUN: %dexter --fail-lt 1.0 -w \13// RUN:     --binary %t %dexter_lldb_args -- %s14#include <deque>15 16struct A {17  int a;18  A(int a) : a(a) {}19  A() : a(0) {}20};21 22using deq_t = std::deque<A>;23 24template class std::deque<A>;25 26static void __attribute__((noinline, optnone)) escape(deq_t &deq) {27  static volatile deq_t *sink;28  sink = &deq;29}30 31int main() {32  deq_t deq;33  deq.push_back(1234);34  deq.push_back(56789);35  escape(deq); // DexLabel('first')36  while (!deq.empty()) {37    auto record = deq.front();38    deq.pop_front();39    escape(deq); // DexLabel('second')40  }41}42 43// DexExpectWatchValue('deq[0].a', '1234', on_line=ref('first'))44// DexExpectWatchValue('deq[1].a', '56789', on_line=ref('first'))45 46// DexExpectWatchValue('deq[0].a', '56789', '0', on_line=ref('second'))47 48