Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / Interpreter / inline-virtual.cpp
blob79ab8ed337ffeaf32a1bec276396354e9e688bc8
1 // REQUIRES: host-supports-jit
2 // UNSUPPORTED: system-aix
3 //
4 // We disable RTTI to avoid problems on Windows for non-RTTI builds of LLVM
5 // where the JIT cannot find ??_7type_info@@6B@.
6 // RUN: cat %s | clang-repl -Xcc -fno-rtti | FileCheck %s
7 // RUN: cat %s | clang-repl -Xcc -fno-rtti -Xcc -O2 | FileCheck %s
9 extern "C" int printf(const char *, ...);
11 struct A { int a; A(int a) : a(a) {} virtual ~A(); };
13 // Then define the virtual destructor as inline out-of-line, in a separate
14 // PartialTranslationUnit.
15 inline A::~A() { printf("~A(%d)\n", a); }
17 // Create one instance with new and delete it.
18 A *a1 = new A(1);
19 delete a1;
20 // CHECK: ~A(1)
22 // Also create one global that will be auto-destructed.
23 A a2(2);
24 // CHECK: ~A(2)