[llvm-branch-commits] [cfe-branch] r270602 - Merging r262838:
Joerg Sonnenberger via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue May 24 12:36:55 PDT 2016
Author: joerg
Date: Tue May 24 14:36:54 2016
New Revision: 270602
URL: http://llvm.org/viewvc/llvm-project?rev=270602&view=rev
Log:
Merging r262838:
------------------------------------------------------------------------
r262838 | joerg | 2016-03-07 18:19:15 +0100 (Mon, 07 Mar 2016) | 2 lines
Implement __builtin_eh_return_data_regno for SPARC and SPARC64.
------------------------------------------------------------------------
Added:
cfe/branches/release_38/test/CodeGen/builtins-sparc.c
Modified:
cfe/branches/release_38/lib/Basic/Targets.cpp
Modified: cfe/branches/release_38/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_38/lib/Basic/Targets.cpp?rev=270602&r1=270601&r2=270602&view=diff
==============================================================================
--- cfe/branches/release_38/lib/Basic/Targets.cpp (original)
+++ cfe/branches/release_38/lib/Basic/Targets.cpp Tue May 24 14:36:54 2016
@@ -5845,6 +5845,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
Added: cfe/branches/release_38/test/CodeGen/builtins-sparc.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_38/test/CodeGen/builtins-sparc.c?rev=270602&view=auto
==============================================================================
--- cfe/branches/release_38/test/CodeGen/builtins-sparc.c (added)
+++ cfe/branches/release_38/test/CodeGen/builtins-sparc.c Tue May 24 14:36:54 2016
@@ -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
+}
More information about the llvm-branch-commits
mailing list