diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2018-07-28 11:06:01 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2018-07-28 11:06:01 +0000 |
| commit | 486754660bb926339aefcf012a3f848592babb8b (patch) | |
| tree | ecdbc446c9876f4f120f701c243373cd3cb43db3 /test/CodeGen/shadowcallstack-attr.c | |
| parent | 55e6d896ad333f07bb3b1ba487df214fc268a4ab (diff) | |
Notes
Diffstat (limited to 'test/CodeGen/shadowcallstack-attr.c')
| -rw-r--r-- | test/CodeGen/shadowcallstack-attr.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/CodeGen/shadowcallstack-attr.c b/test/CodeGen/shadowcallstack-attr.c new file mode 100644 index 000000000000..45e710d87562 --- /dev/null +++ b/test/CodeGen/shadowcallstack-attr.c @@ -0,0 +1,16 @@ +// RUN: %clang_cc1 -triple x86_64-linux-unknown -emit-llvm -o - %s -fsanitize=shadow-call-stack | FileCheck -check-prefix=UNBLACKLISTED %s + +// RUN: %clang_cc1 -D ATTR -triple x86_64-linux-unknown -emit-llvm -o - %s -fsanitize=shadow-call-stack | FileCheck -check-prefix=BLACKLISTED %s + +// RUN: echo -e "[shadow-call-stack]\nfun:foo" > %t +// RUN: %clang_cc1 -fsanitize-blacklist=%t -triple x86_64-linux-unknown -emit-llvm -o - %s -fsanitize=shadow-call-stack | FileCheck -check-prefix=BLACKLISTED %s + +#ifdef ATTR +__attribute__((no_sanitize("shadow-call-stack"))) +#endif +int foo(int *a) { return *a; } + +// CHECK: define i32 @foo(i32* %a) + +// BLACKLISTED-NOT: attributes {{.*}}shadowcallstack{{.*}} +// UNBLACKLISTED: attributes {{.*}}shadowcallstack{{.*}} |
