2019-05-15 05:17:21 +08:00
|
|
|
// Test that HWASan and KHWASan runs with the new pass manager.
|
2020-10-07 07:13:50 +08:00
|
|
|
// We run them under different optimizations to ensure the IR is still
|
2019-05-15 05:17:21 +08:00
|
|
|
// being instrumented properly.
|
|
|
|
|
2020-10-07 07:13:50 +08:00
|
|
|
// 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
|
2019-05-15 05:17:21 +08:00
|
|
|
|
2020-10-07 07:13:50 +08:00
|
|
|
// 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
|
2019-05-15 05:17:21 +08:00
|
|
|
|
|
|
|
int foo(int *a) { return *a; }
|
|
|
|
|
|
|
|
// All the cases above mark the function with sanitize_hwaddress.
|
2020-10-07 07:13:50 +08:00
|
|
|
// CHECK: sanitize_hwaddress
|