xref: /llvm-project/llvm/test/CodeGen/X86/x32-function_pointer-1.ll (revision 2f448bf509432c1a19ec46ab8cbc7353c03c6280)
1; RUN: llc < %s -mtriple=x86_64-linux-gnux32  | FileCheck %s
2; RUN: llc < %s -mtriple=x86_64-linux-gnux32 -fast-isel | FileCheck %s
3
4; Test for x32 function pointer tail call
5
6@foo1 = external dso_local global ptr
7@foo2 = external dso_local global ptr
8
9define void @bar(ptr %h) nounwind uwtable {
10entry:
11  %0 = load ptr, ptr @foo1, align 4
12; CHECK: movl	foo1(%rip), %e{{[^,]*}}
13  tail call void %0(ptr %h) nounwind
14; CHECK: callq	*%r{{[^,]*}}
15  %1 = load ptr, ptr @foo2, align 4
16; CHECK: movl	foo2(%rip), %e{{[^,]*}}
17  tail call void %1(ptr %h) nounwind
18; CHECK: jmpq	*%r{{[^,]*}}
19  ret void
20}
21