summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2014-04-21 01:23:39 +0000
committerBob Wilson <bob.wilson@apple.com>2014-04-21 01:23:39 +0000
commit373af73ad406eb8b8670e18f89631e396a4b1fbe (patch)
tree6d54cbd8957bafbe712fc78876fa6184eeefca40 /clang/test/CodeGen
parent3abf169549f1531324961842388d318ffc3b95a4 (diff)
downloadbcm5719-llvm-373af73ad406eb8b8670e18f89631e396a4b1fbe.tar.gz
bcm5719-llvm-373af73ad406eb8b8670e18f89631e396a4b1fbe.zip
ARM64: Do not expand variadic HFA/HVA arguments with the Darwin ABI.
Unlike the standard AAPCS64 ABI, variadic arguments are always passed on the stack with the Darwin ABI, and this was not being considered when deciding whether to expand HFA/HVA arguments in a call. An HFA argument with a "float" base type was being expanded into separate "float" arguments, each of which was then extended to a double, resulting in a serious mismatch from what is expected by the va_arg implementation. <rdar://problem/15777067> llvm-svn: 206729
Diffstat (limited to 'clang/test/CodeGen')
-rw-r--r--clang/test/CodeGen/arm64-arguments.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/test/CodeGen/arm64-arguments.c b/clang/test/CodeGen/arm64-arguments.c
index c5e489fd856..b2de08dbe68 100644
--- a/clang/test/CodeGen/arm64-arguments.c
+++ b/clang/test/CodeGen/arm64-arguments.c
@@ -640,6 +640,12 @@ float test_hfa(int n, ...) {
return h.d;
}
+float test_hfa_call(struct HFA *a) {
+// CHECK-LABEL: define float @test_hfa_call(%struct.HFA* %a)
+// CHECK: call float (i32, ...)* @test_hfa(i32 1, [2 x double] {{.*}})
+ test_hfa(1, *a);
+}
+
struct TooBigHFA {
float a, b, c, d, e;
};
OpenPOWER on IntegriCloud