[PATCH] D131806: Update hwasan test to fix failure on older Android API versions.

Usman Nadeem via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 12 13:35:48 PDT 2022


mnadeem created this revision.
mnadeem added reviewers: hctim, vitalybuka, kstoimenov.
Herald added a subscriber: danielkiss.
Herald added a project: All.
mnadeem requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

In Android API < 30 there is no HWAsan instrumentation support for globals
so the test fails if API < 30 or if the target triple does not specify the API version.

Add `-mllvm -hwasan-globals` to enable global instrumentation.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D131806

Files:
  clang/test/CodeGen/sanitizer-special-case-list-globals.c


Index: clang/test/CodeGen/sanitizer-special-case-list-globals.c
===================================================================
--- clang/test/CodeGen/sanitizer-special-case-list-globals.c
+++ clang/test/CodeGen/sanitizer-special-case-list-globals.c
@@ -13,7 +13,7 @@
 /// first), which is hard to check for, as 'CHECK-DAG' doesn't play terribly
 /// nicely with 'CHECK-NOT'. This is why the 'always_ignored' and
 /// 'hwasan_ignored' comes first in this file.
-// RUN: %clang_cc1 -fsanitize=hwaddress -emit-llvm %s -o -\
+// RUN: %clang_cc1 -fsanitize=hwaddress -mllvm -hwasan-globals -emit-llvm %s -o -\
 // RUN: -fsanitize-ignorelist=%S/Inputs/sanitizer-special-case-list-globals.txt \
 // RUN: | FileCheck %s --check-prefix=HWASAN
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131806.452291.patch
Type: text/x-patch
Size: 741 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220812/673f2046/attachment.bin>


More information about the cfe-commits mailing list