1 ; RUN: llc -mtriple x86_64-w64-mingw32 %s -o - | FileCheck %s
3 declare void @foo({ float, double }* byval)
4 @G = external constant { float, double }
8 ; Make sure we're creating a temporary stack slot, rather than just passing
9 ; the pointer through unmodified.
11 ; CHECK: movq .refptr.G(%rip), %rax
12 ; CHECK: movq (%rax), %rcx
13 ; CHECK: movq 8(%rax), %rax
14 ; CHECK: movq %rax, 40(%rsp)
15 ; CHECK: movq %rcx, 32(%rsp)
16 ; CHECK: leaq 32(%rsp), %rcx
17 call void @foo({ float, double }* byval @G)
21 define void @baz({ float, double }* byval %arg)
23 ; On Win64 the byval is effectively ignored on declarations, since we do
24 ; pass a real pointer in registers. However, by our semantics if we pass
25 ; the pointer on to another byval function, we do need to make a copy.
27 ; CHECK: movq (%rcx), %rax
28 ; CHECK: movq 8(%rcx), %rcx
29 ; CHECK: movq %rcx, 40(%rsp)
30 ; CHECK: movq %rax, 32(%rsp)
31 ; CHECK: leaq 32(%rsp), %rcx
32 call void @foo({ float, double }* byval %arg)