File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,15 @@ class RISCVTargetInfo : public TargetInfo {
57
57
58
58
ArrayRef<const char *> getGCCRegNames () const override ;
59
59
60
+ int getEHDataRegisterNumber (unsigned RegNo) const override {
61
+ if (RegNo == 0 )
62
+ return 10 ;
63
+ else if (RegNo == 1 )
64
+ return 11 ;
65
+ else
66
+ return -1 ;
67
+ }
68
+
60
69
ArrayRef<TargetInfo::GCCRegAlias> getGCCRegAliases () const override ;
61
70
62
71
bool validateAsmConstraint (const char *&Name,
Original file line number Diff line number Diff line change
1
+ // RUN: %clang_cc1 -Wall -Werror -triple riscv32 -disable-O0-optnone -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
2
+ // RUN: %clang_cc1 -Wall -Werror -triple riscv64 -disable-O0-optnone -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
3
+
4
+ void test_eh_return_data_regno () {
5
+ // CHECK: store volatile i32 10
6
+ // CHECK: store volatile i32 11
7
+ volatile int res ;
8
+ res = __builtin_eh_return_data_regno (0 );
9
+ res = __builtin_eh_return_data_regno (1 );
10
+ }
You can’t perform that action at this time.
0 commit comments