| // RUN: %clangxx_cfi %debug_info_flags -fsanitize-stats -o %t %s |
| // RUN: env SANITIZER_STATS_PATH=%t.stats %run %t |
| // RUN: sanstats %t.stats | FileCheck %s |
| // FIXME: We currently emit the wrong debug info under devirtualization. |
| // FIXME: %t.stats must be transferred from device to host for this to work on Android. |
| extern "C" __attribute__((noinline)) void vcall(A *a) { |
| // CHECK: stats.cpp:[[@LINE+1]] {{_?}}vcall cfi-vcall 37 |
| extern "C" __attribute__((noinline)) void nvcall(A *a) { |
| // CHECK: stats.cpp:[[@LINE+1]] {{_?}}nvcall cfi-nvcall 51 |
| extern "C" __attribute__((noinline)) A *dcast(A *a) { |
| // CHECK: stats.cpp:[[@LINE+1]] {{_?}}dcast cfi-derived-cast 24 |
| extern "C" __attribute__((noinline)) A *ucast(A *a) { |
| // CHECK: stats.cpp:[[@LINE+1]] {{_?}}ucast cfi-unrelated-cast 81 |
| extern "C" __attribute__((noinline)) void unreachable(A *a) { |
| // CHECK-NOT: unreachable |
| for (unsigned i = 0; i != 37; ++i) |
| for (unsigned i = 0; i != 51; ++i) |
| for (unsigned i = 0; i != 24; ++i) |
| for (unsigned i = 0; i != 81; ++i) |
| for (unsigned i = 0; i != 0; ++i) |