1 ; RUN: llc -O0 -mtriple=i386-unknown-linux-gnu -relocation-model=pic < %s | FileCheck %s
3 ; Unbind the ebx with GOT address in regcall calling convention, or the following
4 ; case will failed in register allocation by no register can be used.
6 ;#define REGCALL __attribute__((regcall))
7 ;int REGCALL func (int i1, int i2, int i3, int i4, int i5);
8 ;int (REGCALL *fptr) (int, int, int, int, int) = func;
10 ; return fptr(1,2,3,4,5);
13 @fptr = global ptr @__regcall3__func, align 4
15 declare x86_regcallcc i32 @__regcall3__func(i32 inreg, i32 inreg, i32 inreg, i32 inreg, i32 inreg)
17 ; Function Attrs: noinline nounwind optnone
21 ; CHECK-NEXT: popl %eax
23 ; CHECK-NEXT: addl $_GLOBAL_OFFSET_TABLE_+(.Ltmp0-.L0$pb), %eax
24 ; CHECK-NEXT: movl fptr@GOT(%eax), %eax
25 ; CHECK-NEXT: movl (%eax), %ebx
26 ; CHECK-NEXT: movl $1, %eax
27 ; CHECK-NEXT: movl $2, %ecx
28 ; CHECK-NEXT: movl $3, %edx
29 ; CHECK-NEXT: movl $4, %edi
30 ; CHECK-NEXT: movl $5, %esi
31 ; CHECK-NEXT: calll *%ebx
34 %0 = load ptr, ptr @fptr, align 4
35 %call = call x86_regcallcc i32 %0(i32 inreg 1, i32 inreg 2, i32 inreg 3, i32 inreg 4, i32 inreg 5)