PowerPC: fix __builtin_eh_return_data_regno return

llvm-svn: 173188
This commit is contained in:
Adhemerval Zanella 2013-01-22 20:02:45 +00:00
parent e3aac2c864
commit 5d874aeea9
2 changed files with 14 additions and 0 deletions

View File

@ -818,6 +818,11 @@ public:
virtual const char *getClobbers() const {
return "";
}
int getEHDataRegisterNumber(unsigned RegNo) const {
if (RegNo == 0) return 3;
if (RegNo == 1) return 4;
return -1;
}
};
const Builtin::Info PPCTargetInfo::BuiltinInfo[] = {

View File

@ -0,0 +1,9 @@
// REQUIRES: ppc32-registered-target
// RUN: %clang_cc1 -triple powerpc-unknown-unknown -emit-llvm %s -o - | FileCheck %s
void test_eh_return_data_regno()
{
volatile int res;
res = __builtin_eh_return_data_regno(0); // CHECK: store volatile i32 3
res = __builtin_eh_return_data_regno(1); // CHECK: store volatile i32 4
}