Move it as an EP callback (-O[123]) or in addSanitizersAtO0. This makes it not run in ThinLTO pre-link (like the other sanitizers), so don't check LTO runs in hwasan-new-pm.c. Changing its position also seems to change the generated IR. I think we just need to make sure the pass runs. Reviewed By: leonardchan Differential Revision: https://reviews.llvm.org/D88936
15 lines
855 B
C
15 lines
855 B
C
// Test that HWASan and KHWASan runs with the new pass manager.
|
|
// We run them under different optimizations to ensure the IR is still
|
|
// being instrumented properly.
|
|
|
|
// RUN: %clang_cc1 -triple x86_64-linux-gnu -S -emit-llvm -o - -fexperimental-new-pass-manager -fsanitize=hwaddress %s | FileCheck %s
|
|
// RUN: %clang_cc1 -triple x86_64-linux-gnu -S -emit-llvm -o - -O1 -fexperimental-new-pass-manager -fsanitize=hwaddress %s | FileCheck %s
|
|
|
|
// RUN: %clang_cc1 -triple x86_64-linux-gnu -S -emit-llvm -o - -fexperimental-new-pass-manager -fsanitize=kernel-hwaddress %s | FileCheck %s
|
|
// RUN: %clang_cc1 -triple x86_64-linux-gnu -S -emit-llvm -o - -O1 -fexperimental-new-pass-manager -fsanitize=kernel-hwaddress %s | FileCheck %s
|
|
|
|
int foo(int *a) { return *a; }
|
|
|
|
// All the cases above mark the function with sanitize_hwaddress.
|
|
// CHECK: sanitize_hwaddress
|