xref: /aosp_15_r20/external/llvm/test/CodeGen/X86/call-imm.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=i386-apple-darwin -relocation-model=static | FileCheck -check-prefix X86STA %s
2*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=i386-apple-darwin -relocation-model=pic | FileCheck -check-prefix X86PIC %s
3*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=i386-pc-linux -relocation-model=dynamic-no-pic | FileCheck -check-prefix X86DYN %s
4*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=i386-pc-win32 -relocation-model=static | FileCheck -check-prefix X86WINSTA %s
5*9880d681SAndroid Build Coastguard Worker
6*9880d681SAndroid Build Coastguard Worker; Call to immediate is not safe on x86-64 unless we *know* that the
7*9880d681SAndroid Build Coastguard Worker; call will be within 32-bits pcrel from the dest immediate.
8*9880d681SAndroid Build Coastguard Worker
9*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -march=x86-64 | FileCheck -check-prefix X64 %s
10*9880d681SAndroid Build Coastguard Worker
11*9880d681SAndroid Build Coastguard Worker; PR3666
12*9880d681SAndroid Build Coastguard Worker; PR3773
13*9880d681SAndroid Build Coastguard Worker; rdar://6904453
14*9880d681SAndroid Build Coastguard Worker
15*9880d681SAndroid Build Coastguard Workerdefine i32 @main() nounwind {
16*9880d681SAndroid Build Coastguard Workerentry:
17*9880d681SAndroid Build Coastguard Worker	%0 = call i32 inttoptr (i32 12345678 to i32 (i32)*)(i32 0) nounwind		; <i32> [#uses=1]
18*9880d681SAndroid Build Coastguard Worker	ret i32 %0
19*9880d681SAndroid Build Coastguard Worker}
20*9880d681SAndroid Build Coastguard Worker
21*9880d681SAndroid Build Coastguard Worker; X86STA: {{call.*12345678}}
22*9880d681SAndroid Build Coastguard Worker; X86PIC-NOT: {{call.*12345678}}
23*9880d681SAndroid Build Coastguard Worker; X86DYN: {{call.*12345678}}
24*9880d681SAndroid Build Coastguard Worker; X86WINSTA: {{call.*[*]%eax}}
25*9880d681SAndroid Build Coastguard Worker; X64: {{call.*[*]%rax}}
26