r231280 - Fix test/CodeGen/builtins.c for platforms that don't lower sjlj
Reid Kleckner
reid at kleckner.net
Wed Mar 4 11:24:17 PST 2015
Author: rnk
Date: Wed Mar 4 13:24:16 2015
New Revision: 231280
URL: http://llvm.org/viewvc/llvm-project?rev=231280&view=rev
Log:
Fix test/CodeGen/builtins.c for platforms that don't lower sjlj
Opt in Win64 to supporting sjlj lowering. We have the backend lowering,
so I think this was just an oversight because WinX86_64TargetCodeGenInfo
doesn't inherit from X86_64TargetCodeGenInfo.
Modified:
cfe/trunk/lib/CodeGen/TargetInfo.cpp
cfe/trunk/test/CodeGen/builtin-longjmp.c
cfe/trunk/test/CodeGen/builtins.c
Modified: cfe/trunk/lib/CodeGen/TargetInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/TargetInfo.cpp?rev=231280&r1=231279&r2=231280&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/TargetInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/TargetInfo.cpp Wed Mar 4 13:24:16 2015
@@ -1724,6 +1724,10 @@ public:
unsigned getOpenMPSimdDefaultAlignment(QualType) const override {
return HasAVX ? 32 : 16;
}
+
+ bool hasSjLjLowering(CodeGen::CodeGenFunction &CGF) const override {
+ return true;
+ }
};
void WinX86_64TargetCodeGenInfo::SetTargetAttributes(const Decl *D,
Modified: cfe/trunk/test/CodeGen/builtin-longjmp.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/builtin-longjmp.c?rev=231280&r1=231279&r2=231280&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/builtin-longjmp.c (original)
+++ cfe/trunk/test/CodeGen/builtin-longjmp.c Wed Mar 4 13:24:16 2015
@@ -1,5 +1,6 @@
// RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm < %s| FileCheck %s
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm < %s| FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-windows -emit-llvm < %s| FileCheck %s
// RUN: %clang_cc1 -triple powerpc-unknown-unknown -emit-llvm < %s| FileCheck %s
// RUN: %clang_cc1 -triple powerpc64-unknown-unknown -emit-llvm < %s| FileCheck %s
Modified: cfe/trunk/test/CodeGen/builtins.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/builtins.c?rev=231280&r1=231279&r2=231280&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/builtins.c (original)
+++ cfe/trunk/test/CodeGen/builtins.c Wed Mar 4 13:24:16 2015
@@ -220,6 +220,8 @@ void test_float_builtin_ops(float F, dou
// CHECK: call x86_fp80 @llvm.fabs.f80(x86_fp80
}
+// __builtin_longjmp isn't supported on all platforms, so only test it on X86.
+#ifdef __x86_64__
// CHECK-LABEL: define void @test_builtin_longjmp
void test_builtin_longjmp(void **buffer) {
// CHECK: [[BITCAST:%.*]] = bitcast
@@ -227,6 +229,7 @@ void test_builtin_longjmp(void **buffer)
__builtin_longjmp(buffer, 1);
// CHECK-NEXT: unreachable
}
+#endif
// CHECK-LABEL: define i64 @test_builtin_readcyclecounter
long long test_builtin_readcyclecounter() {
More information about the cfe-commits
mailing list