diff options
| author | Anton Korobeynikov <asl@math.spbu.ru> | 2014-12-02 16:04:58 +0000 |
|---|---|---|
| committer | Anton Korobeynikov <asl@math.spbu.ru> | 2014-12-02 16:04:58 +0000 |
| commit | d90dd7977e2d25a4f190c833114d97d354ce0590 (patch) | |
| tree | 62459a8646ce57164c8f687edfeb4665580f5455 /clang/test/CodeGen/complex-math.c | |
| parent | 870e7909243e0e7c02d40ce363aaf6bd53c28d21 (diff) | |
| download | bcm5719-llvm-d90dd7977e2d25a4f190c833114d97d354ce0590.tar.gz bcm5719-llvm-d90dd7977e2d25a4f190c833114d97d354ce0590.zip | |
Fix invalid calling convention used for libcalls on ARM.
ARM ABI specifies that all the libcalls use soft FP ABI
(even hard FP binaries). These days clang emits _mulsc3 / _muldc3
calls with default (C) calling convention which would be translated
into AAPCS_VFP LLVM calling and thus the result of complex
multiplication will be bogus.
Introduce a way for a target to specify explicitly calling
convention for libcalls. Right now this is temporary correctness
fix. Ultimately, we'll end with intrinsic for complex
multiplication and all calling convention decisions for libcalls
will be put into backend.
llvm-svn: 223123
Diffstat (limited to 'clang/test/CodeGen/complex-math.c')
| -rw-r--r-- | clang/test/CodeGen/complex-math.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/CodeGen/complex-math.c b/clang/test/CodeGen/complex-math.c index 29172fa6d77..36ef271b0ae 100644 --- a/clang/test/CodeGen/complex-math.c +++ b/clang/test/CodeGen/complex-math.c @@ -2,6 +2,7 @@ // RUN: %clang_cc1 %s -O1 -emit-llvm -triple x86_64-pc-win64 -o - | FileCheck %s --check-prefix=X86 // RUN: %clang_cc1 %s -O1 -emit-llvm -triple i686-unknown-unknown -o - | FileCheck %s --check-prefix=X86 // RUN: %clang_cc1 %s -O1 -emit-llvm -triple powerpc-unknown-unknown -o - | FileCheck %s --check-prefix=PPC +// RUN: %clang_cc1 %s -O1 -emit-llvm -triple armv7-none-linux-gnueabihf -o - | FileCheck %s --check-prefix=ARM float _Complex add_float_rr(float a, float b) { // X86-LABEL: @add_float_rr( @@ -471,3 +472,10 @@ _Bool ne_float_cc(float _Complex a, float _Complex b) { // X86: ret return a != b; } + +// Check that the libcall will obtain proper calling convention on ARM +_Complex double foo(_Complex double a, _Complex double b) { + // ARM-LABEL: @foo( + // ARM: call arm_aapcscc { double, double } @__muldc3 + return a*b; +} |

