brintos

brintos / llvm-project-archived public Read only

0
0
Text · 915 B · 3790c11 Raw
29 lines · cpp
1// REQUIRES: host-supports-jit2//3// This test is flaky with ASan: https://github.com/llvm/llvm-project/issues/1354014// UNSUPPORTED: asan5//6// We disable RTTI to avoid problems on Windows for non-RTTI builds of LLVM7// where the JIT cannot find ??_7type_info@@6B@.8// RUN: cat %s | clang-repl -Xcc -fno-rtti -Xcc -fno-sized-deallocation \9// RUN:     | FileCheck %s10// RUN: cat %s | clang-repl -Xcc -fno-rtti -Xcc -fno-sized-deallocation \11// RUN:     -Xcc -O2 | FileCheck %s12 13extern "C" int printf(const char *, ...);14 15struct A { int a; A(int a) : a(a) {} virtual ~A(); };16 17// Then define the virtual destructor as inline out-of-line, in a separate18// PartialTranslationUnit.19inline A::~A() { printf("~A(%d)\n", a); }20 21// Create one instance with new and delete it. We crash here now:22A *a1 = new A(1);23delete a1;24// CHECK: ~A(1)25 26// Also create one global that will be auto-destructed.27A a2(2);28// CHECK: ~A(2)29