llvm-project/clang/test/CodeGen/RISCV/attr-hw-shadow-stack.c
Jesse Huang e91f367419
[Clang][RISCV] Loosen the requirement of -fcf-protection=return to zimop (#152252)
Following https://github.com/llvm/llvm-project/pull/152251
We can now loosen the requirement of `-fcf-protection=return` from
Zicfiss to Zimop
2025-09-09 22:49:40 +08:00

10 lines
617 B
C

// RUN: %clang_cc1 -triple riscv64 -target-feature +zimop -emit-llvm -o - %s -fcf-protection=return | FileCheck %s
// RUN: %clang_cc1 -triple riscv64 -target-feature +zimop -emit-llvm -o - %s | FileCheck -check-prefix=NOSHADOWSTACK %s
// RUN: %clang_cc1 -triple riscv32 -target-feature +zimop -emit-llvm -o - %s -fcf-protection=return | FileCheck %s
// RUN: %clang_cc1 -triple riscv32 -target-feature +zimop -emit-llvm -o - %s | FileCheck -check-prefix=NOSHADOWSTACK %s
int foo(int *a) { return *a; }
// CHECK: attributes {{.*}}"hw-shadow-stack"{{.*}}
// NOSHADOWSTACK-NOT: attributes {{.*}}"hw-shadow-stack"{{.*}}