1// RUN: %clangxx -frtti -fsanitize=vptr -fno-sanitize-recover=vptr %s -o %t
2// RUN: %run %t
3
4// REQUIRES: cxxabi
5// FIXME: Should pass on Android, but started failing around 2023-11-05 for unknown reasons.
6// UNSUPPORTED: target={{.*(windows-msvc|android).*}}
7
8int volatile n;
9
10struct A { virtual ~A() {} };
11struct B: virtual A {};
12struct C: virtual A { ~C() { n = 0; } };
13struct D: virtual B, virtual C {};
14
15int main() { delete new D; }
16

source code of compiler-rt/test/ubsan/TestCases/TypeCheck/vptr-virtual-base-construction.cpp