summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/key-function-vtable.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-05-14 04:08:48 +0000
committerDouglas Gregor <dgregor@apple.com>2010-05-14 04:08:48 +0000
commit83de20f5e3d6db070415f4f529620a6863904e09 (patch)
tree7e6b161ddb58b24acdbe4a235473da999fe30e31 /clang/test/CodeGenCXX/key-function-vtable.cpp
parent64585cdb66aec62b8212ddbb36274b898e2c76d1 (diff)
downloadbcm5719-llvm-83de20f5e3d6db070415f4f529620a6863904e09.tar.gz
bcm5719-llvm-83de20f5e3d6db070415f4f529620a6863904e09.zip
A vtable is used if the key function is defined... even if that key
function's definition is an out-of-class definition marked "inline". Fixes an assertion in WebKit. llvm-svn: 103763
Diffstat (limited to 'clang/test/CodeGenCXX/key-function-vtable.cpp')
-rw-r--r--clang/test/CodeGenCXX/key-function-vtable.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/clang/test/CodeGenCXX/key-function-vtable.cpp b/clang/test/CodeGenCXX/key-function-vtable.cpp
index 251a14e28f2..1cfeb0c5022 100644
--- a/clang/test/CodeGenCXX/key-function-vtable.cpp
+++ b/clang/test/CodeGenCXX/key-function-vtable.cpp
@@ -32,11 +32,20 @@ namespace {
}
testg *testgvar = new testg;
+struct X0 { virtual ~X0(); };
+struct X1 : X0 {
+ virtual void f();
+};
+
+inline void X1::f() { }
+
+void use_X1(X1 *x1) { x1->f(); }
+
// FIXME: The checks are extremely difficult to get right when the globals
// aren't alphabetized
+// CHECK: @_ZTV2X1 = weak_odr constant
// CHECK: @_ZTV5testa = constant [3 x i8*] [i8* null
// CHECK: @_ZTV5testc = weak_odr constant [3 x i8*] [i8* null
// CHECK: @_ZTVN12_GLOBAL__N_15testgE = internal constant [3 x i8*] [i8* null
// CHECK: @_ZTV5teste = weak_odr constant [3 x i8*] [i8* null
// CHECK: @_ZTV5testb = weak_odr constant [3 x i8*] [i8* null
-
OpenPOWER on IntegriCloud