[clang] 835ef6f - [hwasan] Fix stack safety test for old PM.
Florian Mayer via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 27 12:51:15 PDT 2021
Author: Florian Mayer
Date: 2021-07-27T20:50:46+01:00
New Revision: 835ef6f93d5789d3d7d905462e7574a38b30577d
URL: https://github.com/llvm/llvm-project/commit/835ef6f93d5789d3d7d905462e7574a38b30577d
DIFF: https://github.com/llvm/llvm-project/commit/835ef6f93d5789d3d7d905462e7574a38b30577d.diff
LOG: [hwasan] Fix stack safety test for old PM.
With the old PM, the stub for __hwasan_generate_tag is still generated
in the IR, but never called.
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D106858
Added:
Modified:
clang/test/CodeGen/hwasan-stack-safety-analysis.c
Removed:
################################################################################
diff --git a/clang/test/CodeGen/hwasan-stack-safety-analysis.c b/clang/test/CodeGen/hwasan-stack-safety-analysis.c
index 5c4f34027bac..ba50274de282 100644
--- a/clang/test/CodeGen/hwasan-stack-safety-analysis.c
+++ b/clang/test/CodeGen/hwasan-stack-safety-analysis.c
@@ -1,5 +1,8 @@
-// RUN: %clang -fsanitize=hwaddress -target aarch64-linux-gnu -S -emit-llvm -mllvm -hwasan-use-stack-safety=true -mllvm -hwasan-generate-tags-with-calls -O2 %s -o - | FileCheck %s --check-prefix=SAFETY
-// RUN: %clang -fsanitize=hwaddress -target aarch64-linux-gnu -S -emit-llvm -mllvm -hwasan-use-stack-safety=false -mllvm -hwasan-generate-tags-with-calls -O2 %s -o - | FileCheck %s --check-prefix=NOSAFETY
+// RUN: %clang -fno-legacy-pass-manager -fsanitize=hwaddress -target aarch64-linux-gnu -S -emit-llvm -mllvm -hwasan-use-stack-safety=true -mllvm -hwasan-generate-tags-with-calls -O2 %s -o - | FileCheck %s --check-prefix=SAFETY
+// RUN: %clang -fno-legacy-pass-manager -fsanitize=hwaddress -target aarch64-linux-gnu -S -emit-llvm -mllvm -hwasan-use-stack-safety=false -mllvm -hwasan-generate-tags-with-calls -O2 %s -o - | FileCheck %s --check-prefix=NOSAFETY
+
+// RUN: %clang -flegacy-pass-manager -fsanitize=hwaddress -target aarch64-linux-gnu -S -emit-llvm -mllvm -hwasan-use-stack-safety=true -mllvm -hwasan-generate-tags-with-calls -O2 %s -o - | FileCheck %s --check-prefix=SAFETY
+// RUN: %clang -flegacy-pass-manager -fsanitize=hwaddress -target aarch64-linux-gnu -S -emit-llvm -mllvm -hwasan-use-stack-safety=false -mllvm -hwasan-generate-tags-with-calls -O2 %s -o - | FileCheck %s --check-prefix=NOSAFETY
// Default when optimizing, but not with O0.
// RUN: %clang -fsanitize=hwaddress -target aarch64-linux-gnu -S -emit-llvm -mllvm -hwasan-generate-tags-with-calls -O2 %s -o - | FileCheck %s --check-prefix=SAFETY
@@ -10,6 +13,6 @@ int main(int argc, char **argv) {
volatile char *x = buf;
*x = 0;
return buf[0];
- // NOSAFETY: __hwasan_generate_tag
- // SAFETY-NOT: __hwasan_generate_tag
+ // NOSAFETY: call i8 @__hwasan_generate_tag
+ // SAFETY-NOT: call i8 @__hwasan_generate_tag
}
More information about the cfe-commits
mailing list