1 ; RUN: llc < %s -mtriple=x86_64-linux-gnux32 | FileCheck %s
2 ; RUN: llc < %s -mtriple=x86_64-linux-gnux32 -fast-isel | FileCheck %s
4 ; Test calling function pointer passed in struct
6 ; The function argument `h' in
18 ; is passed in the 64-bit %rdi register. The `f' field is in the lower 32
19 ; bits of %rdi register and the `i' field is in the upper 32 bits of %rdi
20 ; register. We need to zero-extend %edi to %rdi before branching via %rdi.
22 define void @bar(i64 %h.coerce) nounwind {
24 %h.sroa.0.0.extract.trunc = trunc i64 %h.coerce to i32
25 %0 = inttoptr i32 %h.sroa.0.0.extract.trunc to void ()*
26 ; CHECK: movl %edi, %e[[REG:.*]]
27 tail call void %0() nounwind
28 ; CHECK: jmpq *%r[[REG]]