summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/vtable-linkage.cpp
diff options
context:
space:
mode:
authorPaul Robinson <paul.robinson@sony.com>2016-12-20 22:22:24 +0000
committerPaul Robinson <paul.robinson@sony.com>2016-12-20 22:22:24 +0000
commite45f43341368219ad994f5c3db01434d03fd12fa (patch)
treea8214c5289d825e04c155d7939acc085927e758c /clang/test/CodeGenCXX/vtable-linkage.cpp
parentffc4aef54295132446403c3c1633b29b8507d7ea (diff)
downloadbcm5719-llvm-e45f43341368219ad994f5c3db01434d03fd12fa.tar.gz
bcm5719-llvm-e45f43341368219ad994f5c3db01434d03fd12fa.zip
Make two vtable tests tolerate C++11.
In C++11 we don't emit vtables as eagerly as we do for C++03, so fiddle the tests to emit them when the test expects them. Differential Revision: http://reviews.llvm.org/D27994 llvm-svn: 290205
Diffstat (limited to 'clang/test/CodeGenCXX/vtable-linkage.cpp')
-rw-r--r--clang/test/CodeGenCXX/vtable-linkage.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/vtable-linkage.cpp b/clang/test/CodeGenCXX/vtable-linkage.cpp
index 0b556d10c3e..2e37c95c630 100644
--- a/clang/test/CodeGenCXX/vtable-linkage.cpp
+++ b/clang/test/CodeGenCXX/vtable-linkage.cpp
@@ -1,6 +1,10 @@
// RUN: %clang_cc1 %s -triple=x86_64-pc-linux -emit-llvm -o %t
+// RUN: %clang_cc1 %s -triple=x86_64-pc-linux -emit-llvm -std=c++03 -o %t.03
+// RUN: %clang_cc1 %s -triple=x86_64-pc-linux -emit-llvm -std=c++11 -o %t.11
// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -disable-llvm-optzns -O3 -emit-llvm -o %t.opt
// RUN: FileCheck %s < %t
+// RUN: FileCheck %s < %t.03
+// RUN: FileCheck %s < %t.11
// RUN: FileCheck --check-prefix=CHECK-OPT %s < %t.opt
namespace {
@@ -33,6 +37,11 @@ void D::f() { }
static struct : D { } e;
+// Force 'e' to be constructed and therefore have a vtable defined.
+void use_e() {
+ e.f();
+}
+
// The destructor is the key function.
template<typename T>
struct E {
OpenPOWER on IntegriCloud