]> git.proxmox.com Git - rustc.git/blob - src/compiler-rt/test/ubsan/TestCases/TypeCheck/vptr-non-unique-typeinfo.cpp
New upstream version 1.12.0+dfsg1
[rustc.git] / src / compiler-rt / test / ubsan / TestCases / TypeCheck / vptr-non-unique-typeinfo.cpp
1 // RUN: %clangxx -frtti -fsanitize=vptr -fno-sanitize-recover=vptr -I%p/Helpers -g %s -fPIC -shared -o %t-lib.so -DBUILD_SO
2 // RUN: %clangxx -frtti -fsanitize=vptr -fno-sanitize-recover=vptr -I%p/Helpers -g %s -O3 -o %t %t-lib.so
3 // RUN: %run %t
4 //
5 // REQUIRES: cxxabi
6
7 struct X {
8 virtual ~X() {}
9 };
10 X *libCall();
11
12 #ifdef BUILD_SO
13
14 X *libCall() {
15 return new X;
16 }
17
18 #else
19
20 int main() {
21 X *px = libCall();
22 delete px;
23 }
24
25 #endif