mirror of https://github.com/microsoft/clang.git
Implement __builtin_eh_return_data_regno for SPARC and SPARC64.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262838 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4d0b0706bc
commit
998d54500c
|
@ -5952,6 +5952,12 @@ public:
|
|||
SparcTargetInfo(const llvm::Triple &Triple)
|
||||
: TargetInfo(Triple), SoftFloat(false) {}
|
||||
|
||||
int getEHDataRegisterNumber(unsigned RegNo) const override {
|
||||
if (RegNo == 0) return 24;
|
||||
if (RegNo == 1) return 25;
|
||||
return -1;
|
||||
}
|
||||
|
||||
bool handleTargetFeatures(std::vector<std::string> &Features,
|
||||
DiagnosticsEngine &Diags) override {
|
||||
// The backend doesn't actually handle soft float yet, but in case someone
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
// REQUIRES: sparc-registered-target
|
||||
// RUN: %clang_cc1 -triple sparc-unknown-unknown -emit-llvm %s -o - | FileCheck %s
|
||||
// RUN: %clang_cc1 -triple sparc64-unknown-unknown -emit-llvm %s -o - | FileCheck %s
|
||||
|
||||
void test_eh_return_data_regno(void)
|
||||
{
|
||||
volatile int res;
|
||||
res = __builtin_eh_return_data_regno(0); // CHECK: store volatile i32 24
|
||||
res = __builtin_eh_return_data_regno(1); // CHECK: store volatile i32 25
|
||||
}
|
Loading…
Reference in New Issue