[PATCH] D106858: [hwasan] Fix stack safety test for old PM.

Florian Mayer via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 27 02:40:30 PDT 2021


fmayer created this revision.
fmayer requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

With the old PM, the stub for __hwasan_generate_tag is still generated
in the IR, but never called.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D106858

Files:
  clang/test/CodeGen/hwasan-stack-safety-analysis.c


Index: clang/test/CodeGen/hwasan-stack-safety-analysis.c
===================================================================
--- clang/test/CodeGen/hwasan-stack-safety-analysis.c
+++ 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 @@
   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
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106858.361953.patch
Type: text/x-patch
Size: 2037 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210727/494a2774/attachment.bin>


More information about the cfe-commits mailing list