1 // RUN: %clangxx_cfi_dso -DSHARED_LIB %s -fPIC -shared -o %dynamiclib %ld_flags_rpath_so
2 // RUN: %clangxx_cfi_dso -g %s -o %t %ld_flags_rpath_exe
3 // RUN: %t 2>&1 | FileCheck --check-prefix=CFI %s
5 // RUN: %clangxx_cfi_dso -DB32 -DSHARED_LIB %s -fPIC -shared -o %dynamiclib %ld_flags_rpath_so
6 // RUN: %clangxx_cfi_dso -DB32 %s -o %t %ld_flags_rpath_exe
7 // RUN: %t 2>&1 | FileCheck --check-prefix=CFI %s
9 // RUN: %clangxx_cfi_dso -DB64 -DSHARED_LIB %s -fPIC -shared -o %dynamiclib %ld_flags_rpath_so
10 // RUN: %clangxx_cfi_dso -DB64 %s -o %t %ld_flags_rpath_exe
11 // RUN: %t 2>&1 | FileCheck --check-prefix=CFI %s
13 // RUN: %clangxx_cfi_dso -DBM -DSHARED_LIB %s -fPIC -shared -o %dynamiclib %ld_flags_rpath_so
14 // RUN: %clangxx_cfi_dso -DBM %s -o %t %ld_flags_rpath_exe
15 // RUN: %t 2>&1 | FileCheck --check-prefix=CFI %s
17 // RUN: %clangxx -DBM -DSHARED_LIB %s -fPIC -shared -o %dynamiclib %ld_flags_rpath_so
18 // RUN: %clangxx -DBM %s -o %t %ld_flags_rpath_exe
19 // RUN: %t 2>&1 | FileCheck --check-prefix=NCFI %s
20 // RUN: %t x 2>&1 | FileCheck --check-prefix=NCFI %s
22 // Tests that the CFI mechanism crashes the program when making a virtual call
23 // to an object of the wrong class but with a compatible vtable, by casting a
24 // pointer to such an object and attempting to make a call through it.
54 int main(int argc
, char *argv
[]) {
59 fprintf(stderr
, "=1=\n");
63 fprintf(stderr
, "=2=\n");