Revert "[lldb][test] Remove compiler version check and use regex" (#124101)
[llvm-project.git] / compiler-rt / test / hwasan / TestCases / cfi.cpp
blob64847398387cabf28dd89272e784add1210f5116
1 // RUN: %clangxx_hwasan -fsanitize=cfi -fno-sanitize-trap=cfi -flto -fvisibility=hidden %s -o %t
2 // RUN: not %run %t 2>&1 | FileCheck %s
4 // REQUIRES: android
6 // Smoke test for CFI + HWASAN.
8 struct A {
9 virtual void f();
12 void A::f() {}
14 int main() {
15 // CHECK: control flow integrity check for type {{.*}} failed during cast to unrelated type
16 A *a = reinterpret_cast<A *>(reinterpret_cast<void *>(&main));
17 (void)a;