[AMDGPU][True16][CodeGen] true16 codegen pattern for v_med3_u/i16 (#121850)
[llvm-project.git] / compiler-rt / test / cfi / sibling.cpp
blobfb6e2f295ff32ae542bd5798fe803c116b07f67a
1 // XFAIL: *
3 // RUN: %clangxx_cfi -o %t1 %s
4 // RUN: %expect_crash %run %t1 2>&1 | FileCheck --check-prefix=CFI %s
6 // RUN: %clangxx_cfi -DB32 -o %t2 %s
7 // RUN: %expect_crash %run %t2 2>&1 | FileCheck --check-prefix=CFI %s
9 // RUN: %clangxx_cfi -DB64 -o %t3 %s
10 // RUN: %expect_crash %run %t3 2>&1 | FileCheck --check-prefix=CFI %s
12 // RUN: %clangxx_cfi -DBM -o %t4 %s
13 // RUN: %expect_crash %run %t4 2>&1 | FileCheck --check-prefix=CFI %s
15 // RUN: %clangxx -o %t5 %s
16 // RUN: %run %t5 2>&1 | FileCheck --check-prefix=NCFI %s
18 // Tests that the CFI enforcement distinguishes between non-overriding siblings.
19 // XFAILed as not implemented yet.
21 #include <stdio.h>
22 #include "utils.h"
24 struct A {
25 virtual void f();
28 void A::f() {}
30 struct B : A {
31 virtual void f();
34 void B::f() {}
36 struct C : A {
39 int main() {
40 create_derivers<B>();
42 B *b = new B;
43 break_optimization(b);
45 // CFI: 1
46 // NCFI: 1
47 fprintf(stderr, "1\n");
49 ((C *)b)->f(); // UB here
51 // CFI-NOT: 2
52 // NCFI: 2
53 fprintf(stderr, "2\n");