[compiler-rt] r297771 - [cfi] Add test for type metadata split issue.

Evgeniy Stepanov via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 14 12:33:44 PDT 2017


Author: eugenis
Date: Tue Mar 14 14:33:44 2017
New Revision: 297771

URL: http://llvm.org/viewvc/llvm-project?rev=297771&view=rev
Log:
[cfi] Add test for type metadata split issue.

https://reviews.llvm.org/D30716

Added:
    compiler-rt/trunk/test/cfi/bad-split.cpp

Added: compiler-rt/trunk/test/cfi/bad-split.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/cfi/bad-split.cpp?rev=297771&view=auto
==============================================================================
--- compiler-rt/trunk/test/cfi/bad-split.cpp (added)
+++ compiler-rt/trunk/test/cfi/bad-split.cpp Tue Mar 14 14:33:44 2017
@@ -0,0 +1,19 @@
+// GlobalSplit used to lose type metadata for classes with virtual bases but no virtual methods.
+// RUN: %clangxx_cfi -o %t1 %s && %t1
+
+struct Z {
+};
+
+struct ZZ : public virtual Z {
+};
+
+struct A : public ZZ {
+};
+
+struct B : public A {
+};
+
+int main() {
+  A* a = new B();
+  B *b = (B*)a;
+}




More information about the llvm-commits mailing list