Update hwasan test to fix failure on older Android API versions.
authorUsman Nadeem <mnadeem@quicinc.com>
Fri, 12 Aug 2022 23:28:04 +0000 (16:28 -0700)
committerUsman Nadeem <mnadeem@quicinc.com>
Fri, 12 Aug 2022 23:30:08 +0000 (16:30 -0700)
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 -triple=aarch64-linux-android31 to enable global instrumentation. This is the
same triple as is used in the RUN line for -fsanitize=memtag-globals.

Differential Revision: https://reviews.llvm.org/D131806

Change-Id: I300703bd126b10e3c52505e23c78c5a48acb0309

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

index a688b00..f2680f2 100644 (file)
@@ -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 -triple=aarch64-linux-android31 -emit-llvm %s -o -\
 // RUN: -fsanitize-ignorelist=%S/Inputs/sanitizer-special-case-list-globals.txt \
 // RUN: | FileCheck %s --check-prefix=HWASAN