1 // RUN: %clangxx_cfi_dso -DSHARED_LIB -fPIC -g -fsanitize-stats -shared -o %t.so %s
2 // RUN: %clangxx_cfi_dso -g -fsanitize-stats -o %t %s %t.so
3 // RUN: env SANITIZER_STATS_PATH=%t.stats %t
4 // RUN: sanstats %t.stats | FileCheck %s
6 // CFI-icall is not implemented in thinlto mode => ".cfi" suffixes are missing
9 // FIXME: %t.stats must be transferred from device to host for this to work on Android.
19 extern "C" void vcall(A
*a
);
20 extern "C" void nvcall(A
*a
);
24 extern "C" __attribute__((noinline
)) void vcall(A
*a
) {
25 // CHECK-DAG: stats.cpp:[[@LINE+1]] vcall.cfi cfi-vcall 37
29 extern "C" __attribute__((noinline
)) void nvcall(A
*a
) {
30 // CHECK-DAG: stats.cpp:[[@LINE+1]] nvcall.cfi cfi-nvcall 51
36 extern "C" __attribute__((noinline
)) A
*dcast(A
*a
) {
37 // CHECK-DAG: stats.cpp:[[@LINE+1]] dcast.cfi cfi-derived-cast 24
38 return (A
*)(ABase
*)a
;
41 extern "C" __attribute__((noinline
)) A
*ucast(A
*a
) {
42 // CHECK-DAG: stats.cpp:[[@LINE+1]] ucast.cfi cfi-unrelated-cast 81
43 return (A
*)(char *)a
;
46 extern "C" __attribute__((noinline
)) void unreachable(A
*a
) {
47 // CHECK-NOT: unreachable
53 for (unsigned i
= 0; i
!= 37; ++i
)
55 for (unsigned i
= 0; i
!= 51; ++i
)
57 for (unsigned i
= 0; i
!= 24; ++i
)
59 for (unsigned i
= 0; i
!= 81; ++i
)
61 for (unsigned i
= 0; i
!= 0; ++i
)