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 | dd913de968fbd4df48a8525715f6ca68c403b13d (patch) | |
| tree | ae824d972690b78d0e0441cc906fda7368f9dbb9 | |
| parent | 3cb183b1216636570b38f8189b43db7d11fc39af (diff) | |
| download | bcm5719-llvm-dd913de968fbd4df48a8525715f6ca68c403b13d.tar.gz bcm5719-llvm-dd913de968fbd4df48a8525715f6ca68c403b13d.zip | |
[cfi] Add test for type metadata split issue.
https://reviews.llvm.org/D30716
llvm-svn: 297771
| -rw-r--r-- | compiler-rt/test/cfi/bad-split.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/compiler-rt/test/cfi/bad-split.cpp b/compiler-rt/test/cfi/bad-split.cpp new file mode 100644 index 00000000000..2f3bef94879 --- /dev/null +++ b/compiler-rt/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; +} |

