diff options
author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2017-03-14 19:33:44 +0000 |
---|---|---|
committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2017-03-14 19:33:44 +0000 |
commit | 625d95f037d24b12f4d4e626a329d27cf10c0f1c (patch) | |
tree | 5da053511ad125b970f72bfc7881c69ecd27bb70 /test/cfi | |
parent | 622ea83a03926ee1f33810b7b3ec32f5a27554da (diff) | |
download | compiler-rt-625d95f037d24b12f4d4e626a329d27cf10c0f1c.tar.gz |
[cfi] Add test for type metadata split issue.
https://reviews.llvm.org/D30716
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@297771 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/cfi')
-rw-r--r-- | test/cfi/bad-split.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/cfi/bad-split.cpp b/test/cfi/bad-split.cpp new file mode 100644 index 000000000..2f3bef948 --- /dev/null +++ b/test/cfi/bad-split.cpp @@ -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; +} |