[clang] [Clang][RISCV] Support -fcf-protection=return for RISC-V (PR #112477)

Kito Cheng via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 25 11:07:04 PDT 2024


================
@@ -0,0 +1,7 @@
+// RUN: %clang_cc1 -triple riscv64-linux-unknown -target-feature +zimop -emit-llvm -o - %s -fcf-protection=return | FileCheck %s
+// RUN: %clang_cc1 -triple riscv64-linux-unknown -target-feature +zimop -emit-llvm -o - %s | FileCheck -check-prefix=NOSHADOWSTACK %s
+
+int foo(int *a) { return *a; }
+
+// SHADOWSTACK-NOT: attributes {{.*}}"hw-shadow-stack"{{.*}}
----------------
kito-cheng wrote:

```suggestion
// NOSHADOWSTACK-NOT: attributes {{.*}}"hw-shadow-stack"{{.*}}
```
Should be something like that?

https://github.com/llvm/llvm-project/pull/112477


More information about the cfe-commits mailing list