File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -145,6 +145,7 @@ foreach(arch ${HWASAN_SUPPORTED_ARCH})
145
145
RTSanitizerCommonCoverage
146
146
RTSanitizerCommonSymbolizer
147
147
RTUbsan
148
+ RTUbsan_cxx
148
149
# The only purpose of RTHWAsan_dynamic_version_script_dummy is to
149
150
# carry a dependency of the shared runtime on the version script.
150
151
# Replacing it with a straightforward
Original file line number Diff line number Diff line change
1
+ // RUN: %clang_hwasan -fsanitize=cfi -fno-sanitize-trap=cfi -flto -fvisibility=hidden -fuse-ld=lld %s -o %t
2
+ // RUN: not %run %t 2>&1 | FileCheck %s
3
+
4
+ // REQUIRES: android
5
+
6
+ // Smoke test for CFI + HWASAN.
7
+
8
+ struct A {
9
+ virtual void f ();
10
+ };
11
+
12
+ void A::f () {}
13
+
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;
18
+ }
You can’t perform that action at this time.
0 commit comments