File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -131,6 +131,13 @@ class RISCVTargetInfo : public TargetInfo {
131
131
bool supportsCpuInit () const override { return getTriple ().isOSLinux (); }
132
132
bool validateCpuSupports (StringRef Feature) const override ;
133
133
bool isValidFeatureName (StringRef Name) const override ;
134
+
135
+ bool
136
+ checkCFProtectionBranchSupported (DiagnosticsEngine &Diags) const override {
137
+ if (ISAInfo->hasExtension (" zicfilp" ))
138
+ return true ;
139
+ return TargetInfo::checkCFProtectionBranchSupported (Diags);
140
+ }
134
141
};
135
142
class LLVM_LIBRARY_VISIBILITY RISCV32TargetInfo : public RISCVTargetInfo {
136
143
public:
Original file line number Diff line number Diff line change
1
+ // RUN: not %clang --target=riscv32 -fcf-protection=branch -c %s \
2
+ // RUN: -o /dev/null 2>&1 \
3
+ // RUN: | FileCheck --check-prefix=CHECK-BRANCH-PROT-INVALID %s
4
+
5
+ // RUN: not %clang --target=riscv32 -fcf-protection=branch -c %s \
6
+ // RUN: -o /dev/null 2>&1 \
7
+ // RUN: | FileCheck --check-prefix=CHECK-BRANCH-PROT-INVALID %s
8
+
9
+ // RUN: not %clang --target=riscv64 -fcf-protection=branch -c %s \
10
+ // RUN: -o /dev/null 2>&1 \
11
+ // RUN: | FileCheck --check-prefix=CHECK-BRANCH-PROT-INVALID %s
12
+
13
+ // RUN: not %clang --target=riscv64 -fcf-protection=branch -c %s \
14
+ // RUN: -o /dev/null 2>&1 \
15
+ // RUN: | FileCheck --check-prefix=CHECK-BRANCH-PROT-INVALID %s
16
+
17
+ // CHECK-BRANCH-PROT-INVALID: error: option 'cf-protection=branch' cannot be
18
+ // CHECK-BRANCH-PROT-INVALID-SAME: specified on this target
You can’t perform that action at this time.
0 commit comments