2021-05-04 21:50:43 +08:00
|
|
|
// RUN: %clang_cc1 -triple x86_64-linux-unknown -emit-llvm -o - %s -fsanitize=shadow-call-stack | FileCheck -check-prefix=NOTIGNORELISTED %s
|
2018-04-04 06:33:53 +08:00
|
|
|
|
2021-05-04 21:50:43 +08:00
|
|
|
// RUN: %clang_cc1 -D ATTR -triple x86_64-linux-unknown -emit-llvm -o - %s -fsanitize=shadow-call-stack | FileCheck -check-prefix=IGNORELISTED %s
|
2018-04-04 06:33:53 +08:00
|
|
|
|
|
|
|
// RUN: echo -e "[shadow-call-stack]\nfun:foo" > %t
|
2021-05-04 21:50:43 +08:00
|
|
|
// RUN: %clang_cc1 -fsanitize-ignorelist=%t -triple x86_64-linux-unknown -emit-llvm -o - %s -fsanitize=shadow-call-stack | FileCheck -check-prefix=IGNORELISTED %s
|
2020-03-27 13:09:31 +08:00
|
|
|
|
2021-05-04 21:50:43 +08:00
|
|
|
// RUN: %clang_cc1 -triple riscv32-linux-gnu -emit-llvm -o - %s -fsanitize=shadow-call-stack | FileCheck -check-prefix=NOTIGNORELISTED %s
|
2020-03-27 13:09:31 +08:00
|
|
|
|
2021-05-04 21:50:43 +08:00
|
|
|
// RUN: %clang_cc1 -D ATTR -triple riscv32-linux-gnu -emit-llvm -o - %s -fsanitize=shadow-call-stack | FileCheck -check-prefix=IGNORELISTED %s
|
2020-03-27 13:09:31 +08:00
|
|
|
|
|
|
|
// RUN: echo -e "[shadow-call-stack]\nfun:foo" > %t
|
2021-05-04 21:50:43 +08:00
|
|
|
// RUN: %clang_cc1 -fsanitize-ignorelist=%t -triple riscv32-linux-gnu -emit-llvm -o - %s -fsanitize=shadow-call-stack | FileCheck -check-prefix=IGNORELISTED %s
|
2020-03-27 13:09:31 +08:00
|
|
|
|
2021-05-04 21:50:43 +08:00
|
|
|
// RUN: %clang_cc1 -triple riscv64-linux-gnu -emit-llvm -o - %s -fsanitize=shadow-call-stack | FileCheck -check-prefix=NOTIGNORELISTED %s
|
2020-03-27 13:09:31 +08:00
|
|
|
|
2021-05-04 21:50:43 +08:00
|
|
|
// RUN: %clang_cc1 -D ATTR -triple riscv64-linux-gnu -emit-llvm -o - %s -fsanitize=shadow-call-stack | FileCheck -check-prefix=IGNORELISTED %s
|
2020-03-27 13:09:31 +08:00
|
|
|
|
|
|
|
// RUN: echo -e "[shadow-call-stack]\nfun:foo" > %t
|
2021-05-04 21:50:43 +08:00
|
|
|
// RUN: %clang_cc1 -fsanitize-ignorelist=%t -triple riscv64-linux-gnu -emit-llvm -o - %s -fsanitize=shadow-call-stack | FileCheck -check-prefix=IGNORELISTED %s
|
2018-04-04 06:33:53 +08:00
|
|
|
|
|
|
|
#ifdef ATTR
|
|
|
|
__attribute__((no_sanitize("shadow-call-stack")))
|
|
|
|
#endif
|
|
|
|
int foo(int *a) { return *a; }
|
|
|
|
|
|
|
|
// CHECK: define i32 @foo(i32* %a)
|
|
|
|
|
2021-05-04 21:50:43 +08:00
|
|
|
// IGNORELISTED-NOT: attributes {{.*}}shadowcallstack{{.*}}
|
|
|
|
// NOTIGNORELISTED: attributes {{.*}}shadowcallstack{{.*}}
|