xref: /aosp_15_r20/external/llvm/test/CodeGen/X86/asm-global-imm.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -march=x86 -relocation-model=static -no-integrated-as | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker; PR882
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard Workertarget datalayout = "e-p:32:32"
5*9880d681SAndroid Build Coastguard Workertarget triple = "i686-apple-darwin9.0.0d2"
6*9880d681SAndroid Build Coastguard Worker@GV = weak global i32 0		; <i32*> [#uses=2]
7*9880d681SAndroid Build Coastguard Worker@str = external global [12 x i8]		; <[12 x i8]*> [#uses=1]
8*9880d681SAndroid Build Coastguard Worker
9*9880d681SAndroid Build Coastguard Workerdefine void @foo() {
10*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: foo:
11*9880d681SAndroid Build Coastguard Worker; CHECK-NOT: ret
12*9880d681SAndroid Build Coastguard Worker; CHECK: test1 $_GV
13*9880d681SAndroid Build Coastguard Worker; CHECK-NOT: ret
14*9880d681SAndroid Build Coastguard Worker; CHECK: test2 _GV
15*9880d681SAndroid Build Coastguard Worker; CHECK: ret
16*9880d681SAndroid Build Coastguard Worker
17*9880d681SAndroid Build Coastguard Worker	tail call void asm sideeffect "test1 $0", "i,~{dirflag},~{fpsr},~{flags}"( i32* @GV )
18*9880d681SAndroid Build Coastguard Worker	tail call void asm sideeffect "test2 ${0:c}", "i,~{dirflag},~{fpsr},~{flags}"( i32* @GV )
19*9880d681SAndroid Build Coastguard Worker	ret void
20*9880d681SAndroid Build Coastguard Worker}
21*9880d681SAndroid Build Coastguard Worker
22*9880d681SAndroid Build Coastguard Workerdefine void @unknown_bootoption() {
23*9880d681SAndroid Build Coastguard Workerentry:
24*9880d681SAndroid Build Coastguard Worker	call void asm sideeffect "ud2\0A\09.word ${0:c}\0A\09.long ${1:c}\0A", "i,i,~{dirflag},~{fpsr},~{flags}"( i32 235, i8* getelementptr ([12 x i8], [12 x i8]* @str, i32 0, i64 0) )
25*9880d681SAndroid Build Coastguard Worker	ret void
26*9880d681SAndroid Build Coastguard Worker}
27