Skip to content

Commit 62dff01

Browse files
committed
[Clang] Add test for hw-shadodw-stack
1 parent 42132c2 commit 62dff01

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// RUN: %clang_cc1 -triple riscv64-unknown-linux -target-feature +zimop -emit-llvm -o - %s -fcf-protection=return | FileCheck %s
2+
// RUN: %clang_cc1 -triple riscv64-unknown-linux -target-feature +zimop -emit-llvm -o - %s | FileCheck -check-prefix=NOSHADOWSTACK %s
3+
// RUN: %clang_cc1 -triple riscv32-unknown-linux -target-feature +zimop -emit-llvm -o - %s -fcf-protection=return | FileCheck %s
4+
// RUN: %clang_cc1 -triple riscv32-unknown-linux -target-feature +zimop -emit-llvm -o - %s | FileCheck -check-prefix=NOSHADOWSTACK %s
5+
6+
int foo(int *a) { return *a; }
7+
8+
// CHECK: attributes {{.*}}"hw-shadow-stack"{{.*}}
9+
// NOSHADOWSTACK-NOT: attributes {{.*}}"hw-shadow-stack"{{.*}}

0 commit comments

Comments
 (0)