xref: /aosp_15_r20/external/llvm/test/CodeGen/AArch64/inline-asm-globaladdress.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple aarch64-gnu-linux | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple arm64-apple-darwin | FileCheck %s
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard Workertarget datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
5*9880d681SAndroid Build Coastguard Worker
6*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: test_inlineasm_globaladdress:
7*9880d681SAndroid Build Coastguard Worker; CHECK: b {{_?}}test_symbol
8*9880d681SAndroid Build Coastguard Workerdefine void @test_inlineasm_globaladdress() {
9*9880d681SAndroid Build Coastguard Worker  call void asm sideeffect "b $0", "i"(void ()* @test_symbol)
10*9880d681SAndroid Build Coastguard Worker  ret void
11*9880d681SAndroid Build Coastguard Worker}
12*9880d681SAndroid Build Coastguard Worker
13*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: test_inlineasm_globaladdress_offset:
14*9880d681SAndroid Build Coastguard Worker; CHECK: b {{_?}}test_symbol+4
15*9880d681SAndroid Build Coastguard Workerdefine void @test_inlineasm_globaladdress_offset() {
16*9880d681SAndroid Build Coastguard Worker  call void asm sideeffect "b $0", "i"(void ()* bitcast (i8* getelementptr (i8, i8* bitcast (void ()* @test_symbol to i8*), i64 4) to void ()*))
17*9880d681SAndroid Build Coastguard Worker  ret void
18*9880d681SAndroid Build Coastguard Worker}
19*9880d681SAndroid Build Coastguard Worker
20*9880d681SAndroid Build Coastguard Workerdeclare void @test_symbol()
21