xref: /llvm-project/clang/test/CodeGen/hwasan-new-pm.c (revision c5de4dd1eab00df76c1a68c5f397304ceacb71f2)
1 // Test that HWASan and KHWASan runs with the new pass manager.
2 // We run them under different optimizations to ensure the IR is still
3 // being instrumented properly.
4 
5 // RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -o - -fsanitize=hwaddress %s | FileCheck %s
6 // RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -o - -O1 -fsanitize=hwaddress %s | FileCheck %s
7 
8 // RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -o - -fsanitize=kernel-hwaddress %s | FileCheck %s
9 // RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -o - -O1 -fsanitize=kernel-hwaddress %s | FileCheck %s
10 
foo(int * a)11 int foo(int *a) { return *a; }
12 
13 // All the cases above mark the function with sanitize_hwaddress.
14 // CHECK: sanitize_hwaddress
15