1 // RUN: %clang_cc1 -triple x86_64-linux-unknown -emit-llvm -o - %s -fsanitize=shadow-call-stack | FileCheck -check-prefix=NOTIGNORELISTED %s
3 // RUN: %clang_cc1 -D ATTR -triple x86_64-linux-unknown -emit-llvm -o - %s -fsanitize=shadow-call-stack | FileCheck -check-prefix=IGNORELISTED %s
5 // RUN: echo -e "[shadow-call-stack]\nfun:foo" > %t
6 // RUN: %clang_cc1 -fsanitize-ignorelist=%t -triple x86_64-linux-unknown -emit-llvm -o - %s -fsanitize=shadow-call-stack | FileCheck -check-prefix=IGNORELISTED %s
8 // RUN: %clang_cc1 -triple riscv32-linux-gnu -emit-llvm -o - %s -fsanitize=shadow-call-stack | FileCheck -check-prefix=NOTIGNORELISTED %s
10 // RUN: %clang_cc1 -D ATTR -triple riscv32-linux-gnu -emit-llvm -o - %s -fsanitize=shadow-call-stack | FileCheck -check-prefix=IGNORELISTED %s
12 // RUN: echo -e "[shadow-call-stack]\nfun:foo" > %t
13 // RUN: %clang_cc1 -fsanitize-ignorelist=%t -triple riscv32-linux-gnu -emit-llvm -o - %s -fsanitize=shadow-call-stack | FileCheck -check-prefix=IGNORELISTED %s
15 // RUN: %clang_cc1 -triple riscv64-linux-gnu -emit-llvm -o - %s -fsanitize=shadow-call-stack | FileCheck -check-prefix=NOTIGNORELISTED %s
17 // RUN: %clang_cc1 -D ATTR -triple riscv64-linux-gnu -emit-llvm -o - %s -fsanitize=shadow-call-stack | FileCheck -check-prefix=IGNORELISTED %s
19 // RUN: echo -e "[shadow-call-stack]\nfun:foo" > %t
20 // RUN: %clang_cc1 -fsanitize-ignorelist=%t -triple riscv64-linux-gnu -emit-llvm -o - %s -fsanitize=shadow-call-stack | FileCheck -check-prefix=IGNORELISTED %s
23 __attribute__((no_sanitize("shadow-call-stack")))
25 int foo(int *a
) { return *a
; }
27 // CHECK: define i32 @foo(ptr %a)
29 // IGNORELISTED-NOT: attributes {{.*}}shadowcallstack{{.*}}
30 // NOTIGNORELISTED: attributes {{.*}}shadowcallstack{{.*}}