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 global void (i8*)*
7@foo2 = external global void (i8*)*
8
9define void @bar(i8* %h) nounwind uwtable {
10entry:
11  %0 = load void (i8*)*, void (i8*)** @foo1, align 4
12; CHECK: movl	foo1(%rip), %e{{[^,]*}}
13  tail call void %0(i8* %h) nounwind
14; CHECK: callq	*%r{{[^,]*}}
15  %1 = load void (i8*)*, void (i8*)** @foo2, align 4
16; CHECK: movl	foo2(%rip), %e{{[^,]*}}
17  tail call void %1(i8* %h) nounwind
18; CHECK: jmpq	*%r{{[^,]*}}
19  ret void
20}
21