xref: /aosp_15_r20/external/llvm/test/CodeGen/X86/2010-07-06-asm-RIP.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=x86_64-apple-darwin -no-integrated-as | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker; PR 4752
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard Worker@n = global i32 0                                 ; <i32*> [#uses=2]
5*9880d681SAndroid Build Coastguard Worker
6*9880d681SAndroid Build Coastguard Workerdefine void @f(i32*) nounwind ssp {
7*9880d681SAndroid Build Coastguard Worker  ret void
8*9880d681SAndroid Build Coastguard Worker}
9*9880d681SAndroid Build Coastguard Worker
10*9880d681SAndroid Build Coastguard Workerdefine void @g() nounwind ssp {
11*9880d681SAndroid Build Coastguard Workerentry:
12*9880d681SAndroid Build Coastguard Worker; CHECK: _g:
13*9880d681SAndroid Build Coastguard Worker; CHECK: push $_f$_f
14*9880d681SAndroid Build Coastguard Worker; CHECK: call _f(%rip)
15*9880d681SAndroid Build Coastguard Worker  call void asm sideeffect "push\09$1$1\0A\09call\09${1:a}\0A\09pop\09%edx", "imr,i,~{dirflag},~{fpsr},~{flags},~{memory},~{cc},~{edi},~{esi},~{edx},~{ecx},~{ebx},~{eax}"(i32* @n, void (i32*)* @f) nounwind
16*9880d681SAndroid Build Coastguard Worker  br label %return
17*9880d681SAndroid Build Coastguard Worker
18*9880d681SAndroid Build Coastguard Workerreturn:                                           ; preds = %entry
19*9880d681SAndroid Build Coastguard Worker  ret void
20*9880d681SAndroid Build Coastguard Worker}
21*9880d681SAndroid Build Coastguard Worker
22