[PATCH] D105703: [hwasan] Use stack safety analysis.

Florian Mayer via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 16 08:04:18 PDT 2021


fmayer marked 3 inline comments as done.
fmayer added inline comments.


================
Comment at: llvm/test/CodeGen/hwasan-stack-safety-analysis-asm.c:1
+// RUN: %clang -fsanitize=hwaddress -target aarch64-linux-gnu -S -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 -mllvm -hwasan-use-stack-safety=false -mllvm -hwasan-generate-tags-with-calls -O2 %s -o - | FileCheck %s --check-prefix=NOSAFETY
----------------
eugenis wrote:
> You can't use %clang in LLVM tests. There may be no clang. Use opt to invoke the hwasan pass in isolation, see the tests under test/Instrumentation/HWAddressSanitizer/.
> 
> The reason I did not say anything about the tests was because only in clang we can test this thing end-to-end.
> Perhaps an LLVM test for instrumentation + a clang test for the passmanager (use -fdebug-pass-manager and -mllvm -debug-pass=Structure for new/old).
> 
added an extra llvm test to check from IR, and left the existing clang end to end tests..


================
Comment at: llvm/test/CodeGen/hwasan-stack-safety-analysis-asm.c:8
+
+int main(int argc, char **argv) {
+  char buf[10];
----------------
vitalybuka wrote:
> these tests do not work because %clang is not defined here, in LLVM
> you can keep them but they need to stay in clang/
> 
> my request was to add new tests in llvm-project/llvm/test/Instrumentation/HWAddressSanitizer/
> and they need to be *.ll tests
> you probably can generate them from C and cleanup manually
> or close existing *.ll tests and CHECK for expected difference if analysis is enabled
> 
> Also try to generated CHECK statements with llvm/utils/update_test_checks.py, often result is quite useful.
added llvm test.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105703/new/

https://reviews.llvm.org/D105703



More information about the cfe-commits mailing list