xref: /aosp_15_r20/external/llvm/test/CodeGen/X86/x32-function_pointer-2.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=x86_64-linux-gnux32 | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=x86_64-linux-gnux32 -fast-isel | FileCheck %s
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard Worker; Test call function pointer with function argument
5*9880d681SAndroid Build Coastguard Worker;
6*9880d681SAndroid Build Coastguard Worker; void bar (void * h, void (*foo) (void *))
7*9880d681SAndroid Build Coastguard Worker;    {
8*9880d681SAndroid Build Coastguard Worker;      foo (h);
9*9880d681SAndroid Build Coastguard Worker;      foo (h);
10*9880d681SAndroid Build Coastguard Worker;    }
11*9880d681SAndroid Build Coastguard Worker
12*9880d681SAndroid Build Coastguard Worker
13*9880d681SAndroid Build Coastguard Workerdefine void @bar(i8* %h, void (i8*)* nocapture %foo) nounwind {
14*9880d681SAndroid Build Coastguard Workerentry:
15*9880d681SAndroid Build Coastguard Worker  tail call void %foo(i8* %h) nounwind
16*9880d681SAndroid Build Coastguard Worker; CHECK: mov{{l|q}}	%{{e|r}}si, %{{e|r}}[[REG:.*]]{{d?}}
17*9880d681SAndroid Build Coastguard Worker; CHECK: callq	*%r[[REG]]
18*9880d681SAndroid Build Coastguard Worker  tail call void %foo(i8* %h) nounwind
19*9880d681SAndroid Build Coastguard Worker; CHECK: jmpq	*%r{{[^,]*}}
20*9880d681SAndroid Build Coastguard Worker  ret void
21*9880d681SAndroid Build Coastguard Worker}
22