summaryrefslogtreecommitdiff
path: root/test/cfi/bad-split.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-04-16 16:02:53 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-04-16 16:02:53 +0000
commitab0bf875a5f328a6710f4e48258979ae1bc8da1c (patch)
tree66903cf9f73151825893dcc216b04c0930317a10 /test/cfi/bad-split.cpp
parentabacad30a54c59ad437ccf54ec5236a8dd7f3ba9 (diff)
Diffstat (limited to 'test/cfi/bad-split.cpp')
-rw-r--r--test/cfi/bad-split.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/cfi/bad-split.cpp b/test/cfi/bad-split.cpp
new file mode 100644
index 0000000000000..53504bd2710b7
--- /dev/null
+++ b/test/cfi/bad-split.cpp
@@ -0,0 +1,21 @@
+// GlobalSplit used to lose type metadata for classes with virtual bases but no virtual methods.
+// RUN: %clangxx_cfi -o %t1 %s && %t1
+
+// UNSUPPORTED: win32
+
+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;
+}