[clang] 243fc3d - fix-forward hwasan-globals.cpp (round 2)

Mitch Phillips via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 24 14:51:21 PDT 2022


Author: Mitch Phillips
Date: 2022-06-24T14:49:37-07:00
New Revision: 243fc3daf675ea047bb80c21c62d24a331da8b16

URL: https://github.com/llvm/llvm-project/commit/243fc3daf675ea047bb80c21c62d24a331da8b16
DIFF: https://github.com/llvm/llvm-project/commit/243fc3daf675ea047bb80c21c62d24a331da8b16.diff

LOG: fix-forward hwasan-globals.cpp (round 2)

Just force the aarch64 target compilation (after making sure the test
only runs if that target is available).

Because global metadata isn't target-specific, just selecting a target
here is fine.

Should fix https://reviews.llvm.org/D127544#3609312

Added: 
    

Modified: 
    clang/test/CodeGen/hwasan-globals.cpp

Removed: 
    


################################################################################
diff  --git a/clang/test/CodeGen/hwasan-globals.cpp b/clang/test/CodeGen/hwasan-globals.cpp
index 9424efacb381..39460d3297b4 100644
--- a/clang/test/CodeGen/hwasan-globals.cpp
+++ b/clang/test/CodeGen/hwasan-globals.cpp
@@ -1,13 +1,14 @@
-// REQUIRES: aarch64-registered-target || x86-registered-target
+// REQUIRES: aarch64-registered-target
 
 // RUN: %clang_cc1 -include %S/Inputs/sanitizer-extra-source.cpp \
 // RUN:   -fsanitize-ignorelist=%S/Inputs/sanitizer-ignorelist-global.txt \
-// RUN:   -fsanitize=hwaddress -emit-llvm -o - %s | FileCheck %s
+// RUN:   -fsanitize=hwaddress -emit-llvm -triple aarch64-linux-android31 -o -\
+// RUN:    %s | FileCheck %s
 
 // RUN: %clang_cc1 -include %S/Inputs/sanitizer-extra-source.cpp \
 // RUN:   -fsanitize-ignorelist=%S/Inputs/sanitizer-ignorelist-src.txt \
-// RUN:   -fsanitize=hwaddress -emit-llvm -o - %s | \
-// RUN:   FileCheck %s --check-prefix=IGNORELIST
+// RUN:   -fsanitize=hwaddress -emit-llvm -triple aarch64-linux-android31 -o -\
+// RUN:   %s | FileCheck %s --check-prefix=IGNORELIST
 
 int global;
 int __attribute__((no_sanitize("hwaddress"))) attributed_global;
@@ -31,14 +32,14 @@ void func() {
 // CHECK: ![[EXTRA_GLOBAL]] = !{{{.*}} ![[EXTRA_GLOBAL_LOC:[0-9]+]], !"extra_global", i1 false, i1 false}
 // CHECK: ![[EXTRA_GLOBAL_LOC]] = !{!"{{.*}}extra-source.cpp", i32 1, i32 5}
 // CHECK: ![[GLOBAL]] = !{{{.*}} ![[GLOBAL_LOC:[0-9]+]], !"global", i1 false, i1 false}
-// CHECK: ![[GLOBAL_LOC]] = !{!"{{.*}}hwasan-globals.cpp", i32 12, i32 5}
+// CHECK: ![[GLOBAL_LOC]] = !{!"{{.*}}hwasan-globals.cpp", i32 13, i32 5}
 // CHECK: ![[ATTR_GLOBAL]] = !{{{.*attributed_global.*}}, null, null, i1 false, i1 true}
 // CHECK: ![[DISABLE_INSTR_GLOBAL]] = !{{{.*disable_instrumentation_global.*}}, null, null, i1 false, i1 true}
 // CHECK: ![[IGNORELISTED_GLOBAL]] = !{{{.*ignorelisted_global.*}}, null, null, i1 false, i1 true}
 // CHECK: ![[STATIC_VAR]] = !{{{.*}} ![[STATIC_LOC:[0-9]+]], !"static_var", i1 false, i1 false}
-// CHECK: ![[STATIC_LOC]] = !{!"{{.*}}hwasan-globals.cpp", i32 18, i32 14}
+// CHECK: ![[STATIC_LOC]] = !{!"{{.*}}hwasan-globals.cpp", i32 19, i32 14}
 // CHECK: ![[LITERAL]] = !{{{.*}} ![[LITERAL_LOC:[0-9]+]], !"<string literal>", i1 false, i1 false}
-// CHECK: ![[LITERAL_LOC]] = !{!"{{.*}}hwasan-globals.cpp", i32 19, i32 25}
+// CHECK: ![[LITERAL_LOC]] = !{!"{{.*}}hwasan-globals.cpp", i32 20, i32 25}
 
 // IGNORELIST: @{{.*}}global{{.*}} ={{.*}} global {{.*}}, no_sanitize_hwaddress
 // IGNORELIST: @{{.*}}attributed_global{{.*}} ={{.*}} global {{.*}}, no_sanitize_hwaddress


        


More information about the cfe-commits mailing list