Skip to content

Commit bf80217

Browse files
committed
[Clang][RISCV] Loosen the requirement of -fcf-protection return to zimop
1 parent 9bbf22c commit bf80217

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

clang/lib/Basic/Targets/RISCV.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ class RISCVTargetInfo : public TargetInfo {
147147

148148
bool
149149
checkCFProtectionReturnSupported(DiagnosticsEngine &Diags) const override {
150-
if (ISAInfo->hasExtension("zicfiss"))
150+
if (ISAInfo->hasExtension("zimop"))
151151
return true;
152152
return TargetInfo::checkCFProtectionReturnSupported(Diags);
153153
}

clang/test/CodeGen/RISCV/attr-hw-shadow-stack.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
// RUN: %clang_cc1 -triple riscv64 -target-feature +experimental-zicfiss -emit-llvm -o - %s -fcf-protection=return | FileCheck %s
2-
// RUN: %clang_cc1 -triple riscv64 -target-feature +experimental-zicfiss -emit-llvm -o - %s | FileCheck -check-prefix=NOSHADOWSTACK %s
3-
// RUN: %clang_cc1 -triple riscv32 -target-feature +experimental-zicfiss -emit-llvm -o - %s -fcf-protection=return | FileCheck %s
4-
// RUN: %clang_cc1 -triple riscv32 -target-feature +experimental-zicfiss -emit-llvm -o - %s | FileCheck -check-prefix=NOSHADOWSTACK %s
1+
// RUN: %clang_cc1 -triple riscv64 -target-feature +zimop -emit-llvm -o - %s -fcf-protection=return | FileCheck %s
2+
// RUN: %clang_cc1 -triple riscv64 -target-feature +zimop -emit-llvm -o - %s | FileCheck -check-prefix=NOSHADOWSTACK %s
3+
// RUN: %clang_cc1 -triple riscv32 -target-feature +zimop -emit-llvm -o - %s -fcf-protection=return | FileCheck %s
4+
// RUN: %clang_cc1 -triple riscv32 -target-feature +zimop -emit-llvm -o - %s | FileCheck -check-prefix=NOSHADOWSTACK %s
55

66
int foo(int *a) { return *a; }
77

0 commit comments

Comments
 (0)