summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test/cfi/bad-split.cpp
blob: dbbd7ecef0ced9e9c8c56f4985a65ce707b01ac4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// GlobalSplit used to lose type metadata for classes with virtual bases but no virtual methods.
// RUN: %clangxx_cfi -o %t1 %s && %run %t1

// UNSUPPORTED: windows-msvc

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;
}
OpenPOWER on IntegriCloud