summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/speculative-vtt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/CodeGenCXX/speculative-vtt.cpp')
-rw-r--r--clang/test/CodeGenCXX/speculative-vtt.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/speculative-vtt.cpp b/clang/test/CodeGenCXX/speculative-vtt.cpp
new file mode 100644
index 00000000000..120d95d4d48
--- /dev/null
+++ b/clang/test/CodeGenCXX/speculative-vtt.cpp
@@ -0,0 +1,13 @@
+// RUN: %clang_cc1 -triple x86_64-linux-gnu %s -O2 -disable-llvm-passes -emit-llvm -o - | FileCheck %s
+struct A { virtual ~A(); };
+template<typename T> struct B : virtual A {
+ ~B() override {}
+};
+struct C : B<int>, B<float> { C(); ~C() override; };
+struct D : C { ~D() override; };
+
+// We must not create a reference to B<int>::~B() here, because we're not going to emit it.
+// CHECK-NOT: @_ZN1BIiED1Ev
+// CHECK-NOT: @_ZTC1D0_1BIiE =
+// CHECK-NOT: @_ZTT1D = available_externally
+D *p = new D;
OpenPOWER on IntegriCloud