xref: /aosp_15_r20/external/llvm/test/CodeGen/X86/x32-function_pointer-2.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
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 call function pointer with function argument
5;
6; void bar (void * h, void (*foo) (void *))
7;    {
8;      foo (h);
9;      foo (h);
10;    }
11
12
13define void @bar(i8* %h, void (i8*)* nocapture %foo) nounwind {
14entry:
15  tail call void %foo(i8* %h) nounwind
16; CHECK: mov{{l|q}}	%{{e|r}}si, %{{e|r}}[[REG:.*]]{{d?}}
17; CHECK: callq	*%r[[REG]]
18  tail call void %foo(i8* %h) nounwind
19; CHECK: jmpq	*%r{{[^,]*}}
20  ret void
21}
22