summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/vtable-available-externally.cpp
diff options
context:
space:
mode:
authorPiotr Padlewski <prazek@google.com>2015-09-10 20:18:30 +0000
committerPiotr Padlewski <prazek@google.com>2015-09-10 20:18:30 +0000
commit2d836afad956fe17ab843e04468f11eb66b133da (patch)
tree54fa155a31d81315fbdaabb76dd7b73ecf0e3438 /test/CodeGenCXX/vtable-available-externally.cpp
parentb1a88d8dd624128c642702426dfa79937aaedcfb (diff)
Revert "Generating assumption loads of vptr after ctor call (fixed)"
It seems that there is small bug, and we can't generate assume loads when some virtual functions have internal visibiliy This reverts commit 982bb7d966947812d216489b3c519c9825cacbf2. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247332 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/vtable-available-externally.cpp')
-rw-r--r--test/CodeGenCXX/vtable-available-externally.cpp25
1 files changed, 13 insertions, 12 deletions
diff --git a/test/CodeGenCXX/vtable-available-externally.cpp b/test/CodeGenCXX/vtable-available-externally.cpp
index ba56499f67..4527efca96 100644
--- a/test/CodeGenCXX/vtable-available-externally.cpp
+++ b/test/CodeGenCXX/vtable-available-externally.cpp
@@ -184,10 +184,10 @@ void f() {
} // Test8
namespace Test9 {
-// All virtual functions are outline, so we can assume that it will
-// be generated in translation unit where foo is defined.
-// CHECK-TEST9-DAG: @_ZTVN5Test91AE = available_externally unnamed_addr constant
-// CHECK-TEST9-DAG: @_ZTVN5Test91BE = available_externally unnamed_addr constant
+// all virtual functions are outline, so we can assume that it will
+// be generated in translation unit where foo is defined
+// CHECK-TEST9: @_ZTVN5Test91AE = available_externally unnamed_addr constant
+// CHECK-TEST9: @_ZTVN5Test91BE = available_externally unnamed_addr constant
struct A {
virtual void foo();
virtual void bar();
@@ -210,22 +210,22 @@ void g() {
namespace Test10 {
// because A's key function is defined here, vtable is generated in this TU
-// CHECK-TEST10-DAG: @_ZTVN6Test101AE = unnamed_addr constant
+// CHECK-TEST10: @_ZTVN6Test101AE = unnamed_addr constant
struct A {
virtual void foo();
virtual void bar();
};
void A::foo() {}
-// Because key function is inline we will generate vtable as linkonce_odr.
-// CHECK-TEST10-DAG: @_ZTVN6Test101DE = linkonce_odr unnamed_addr constant
+// Because key function is inline we will generate vtable as linkonce_odr
+// CHECK-TEST10: @_ZTVN6Test101DE = linkonce_odr unnamed_addr constant
struct D : A {
void bar();
};
inline void D::bar() {}
-// Because B has outline all virtual functions, we can refer to them.
-// CHECK-TEST10-DAG: @_ZTVN6Test101BE = available_externally unnamed_addr constant
+// because B has outline key function then we can refer to
+// CHECK-TEST10: @_ZTVN6Test101BE = available_externally unnamed_addr constant
struct B : A {
void foo();
void bar();
@@ -233,8 +233,8 @@ struct B : A {
// C's key function (car) is outline, but C has inline virtual function so we
// can't guarantee that we will be able to refer to bar from name
-// so (at the moment) we can't emit vtable available_externally.
-// CHECK-TEST10-DAG: @_ZTVN6Test101CE = external unnamed_addr constant
+// so (at the moment) we can't emit vtable available_externally
+// CHECK-TEST10: @_ZTVN6Test101CE = external unnamed_addr constant
struct C : A {
void bar() {} // defined in body - not key function
virtual inline void gar(); // inline in body - not key function
@@ -242,7 +242,7 @@ struct C : A {
};
// no key function, vtable will be generated everywhere it will be used
-// CHECK-TEST10-DAG: @_ZTVN6Test101EE = linkonce_odr unnamed_addr constant
+// CHECK-TEST10: @_ZTVN6Test101EE = linkonce_odr unnamed_addr constant
struct E : A {};
void g(A& a) {
@@ -365,3 +365,4 @@ void test() {
}
}
+