Skip to content
Snippets Groups Projects
Commit 768efe7b authored by Paul Robinson's avatar Paul Robinson
Browse files

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290205 91177308-0d34-0410-b5e6-96231b3b80d8
parent c8c1a196
No related branches found
No related tags found
No related merge requests found
......@@ -1919,6 +1919,8 @@ namespace Test40 {
virtual int i(int);
virtual int i();
};
// Force C's vtable to be generated.
int C::f() { return 1; }
class D : C {};
......
// 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 {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment