]> granicus.if.org Git - clang/commitdiff
Fix test/CodeGen/builtins.c for platforms that don't lower sjlj
authorReid Kleckner <reid@kleckner.net>
Wed, 4 Mar 2015 19:24:16 +0000 (19:24 +0000)
committerReid Kleckner <reid@kleckner.net>
Wed, 4 Mar 2015 19:24:16 +0000 (19:24 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@231280 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/TargetInfo.cpp
test/CodeGen/builtin-longjmp.c
test/CodeGen/builtins.c

index 31f4a4353518b27792699419e0c6138cec30ff1d..0fa61378995d980ae845dff9d316bb51af62ef7b 100644 (file)
@@ -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,
index 8c895af51676cfbcdf4aace2b741ab15527add8d..73ef4f2bf8c63b19d12a1e6f43ac5be0d104bd91 100644 (file)
@@ -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
 
index 1ab29a659b31a8de05425f4d3cca43d817f841f2..bf7874b088627bb3f4ff90a50edeb1f44521b992 100644 (file)
@@ -220,6 +220,8 @@ void test_float_builtin_ops(float F, double D, long double LD) {
   // 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() {