19 lines · cpp
1// RUN: %clangxx_hwasan -fsanitize=cfi -fno-sanitize-trap=cfi -flto -fvisibility=hidden %s -o %t2// RUN: not %run %t 2>&1 | FileCheck %s3 4// REQUIRES: android5 6// Smoke test for CFI + HWASAN.7 8struct A {9 virtual void f();10};11 12void A::f() {}13 14int main() {15 // CHECK: control flow integrity check for type {{.*}} failed during cast to unrelated type16 A *a = reinterpret_cast<A *>(reinterpret_cast<void *>(&main));17 (void)a;18}19