diff options
author | Joerg Sonnenberger <joerg@bec.de> | 2015-03-12 11:14:45 +0000 |
---|---|---|
committer | Joerg Sonnenberger <joerg@bec.de> | 2015-03-12 11:14:45 +0000 |
commit | 1d3945d684dbc51b792b79e99abb31153d18caad (patch) | |
tree | 02ed4383eb3d67359770f7728d2074ea11a5e0c1 /test/CodeGen/builtins.c | |
parent | 4233c57765bafdb2b0a4023c0ab3237882360ed5 (diff) |
Merge r230255,231245,231280,231986:
Only lower __builtin_setjmp / __builtin_longjmp to
llvm.eh.sjlj.setjmp / llvm.eh.sjlj.longjmp, if the backend is known to
support them outside the Exception Handling context. The default
handling in LLVM codegen doesn't work and will create incorrect code.
The ARM backend on the other hand will assert if the intrinsics are
used.
--
Adjust the changes from r230255 to bail out if the backend can't lower
__builtin_setjmp/__builtin_longjmp and don't fall back to the libc
functions.
--
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.
--
Under duress, move check for target support of __builtin_setjmp/
__builtin_longjmp to Sema as requested by John McCall.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_36@232028 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/builtins.c')
-rw-r--r-- | test/CodeGen/builtins.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/CodeGen/builtins.c b/test/CodeGen/builtins.c index 1ab29a659b..bf7874b088 100644 --- a/test/CodeGen/builtins.c +++ b/test/CodeGen/builtins.c @@ -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() { |