xref: /llvm-project/llvm/test/CodeGen/X86/tailcall-3regparm.ll (revision 2f448bf509432c1a19ec46ab8cbc7353c03c6280)
1; RUN: llc < %s -mtriple=i686-linux-gnu -mcpu=pentium | FileCheck %s
2
3; Tail call should not make register allocation fail (x86-32)
4
5%struct.anon = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr }
6%struct.BIG_PARM = type { i32 }
7
8@vtable = internal unnamed_addr constant [1 x %struct.anon] [%struct.anon { ptr inttoptr (i32 -559038737 to ptr), ptr null, ptr null, ptr null, ptr null, ptr null, ptr null }], align 4
9
10; Function Attrs: nounwind uwtable
11define dso_local i32 @something(ptr inreg noundef %a, ptr inreg noundef %b) local_unnamed_addr #0 {
12entry:
13  ; CHECK:	movl	(%eax), %ecx
14  ; CHECK-NEXT: leal	(%ecx,%ecx,8), %esi
15  ; CHECK-NEXT: leal	(%esi,%esi,2), %esi
16  ; CHECK-NEXT: movl	vtable(%ecx,%esi), %ecx
17  ; CHECK-NEXT: popl	%esi
18  ; CHECK: jmpl	*%ecx
19  %0 = load i32, ptr %a, align 4
20  %foo = getelementptr [1 x %struct.anon], ptr @vtable, i32 0, i32 %0, i32 0
21  %1 = load ptr, ptr %foo, align 4
22  %call = tail call i32 %1(ptr inreg noundef %a, ptr inreg noundef %b) #1
23  ret i32 %call
24}
25
26!llvm.module.flags = !{!0}
27
28!0 = !{i32 1, !"NumRegisterParameters", i32 3}
29
30