1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=aarch64 -relocation-model=pic < %s | FileCheck %s
4 ;; Test that we use the local alias for dso_local functions in inline assembly.
6 @gv0 = dso_local global i32 0
7 @gv1 = dso_preemptable global i32 1
9 define i64 @test_var() nounwind {
10 ; CHECK-LABEL: test_var:
11 ; CHECK: // %bb.0: // %entry
13 ; CHECK-NEXT: adrp x0, .Lgv0$local
14 ; CHECK-NEXT: ldr w0, [x0, :lo12:.Lgv0$local]
15 ; CHECK-NEXT: adrp x8, gv1
16 ; CHECK-NEXT: ldr w8, [x8, :lo12:gv1]
17 ; CHECK-NEXT: add x0, x8, x0
18 ; CHECK-NEXT: //NO_APP
21 %0 = tail call i64 asm "adrp $0, $1\0Aldr ${0:w}, [$0, :lo12:$1]\0Aadrp x8, $2\0Aldr w8, [x8, :lo12:$2]\0Aadd $0,x8,$0", "=r,S,S,~{x8}"(ptr nonnull @gv0, ptr nonnull @gv1)
25 define dso_local void @fun0() nounwind {
27 ; CHECK: .Lfun0$local:
28 ; CHECK-NEXT: .type .Lfun0$local,@function
29 ; CHECK-NEXT: // %bb.0: // %entry
35 define dso_preemptable void @fun1() nounwind {
37 ; CHECK: // %bb.0: // %entry
43 define i64 @test_fun() nounwind {
44 ; CHECK-LABEL: test_fun:
45 ; CHECK: // %bb.0: // %entry
47 ; CHECK-NEXT: adrp x0, :got:.Lfun0$local
48 ; CHECK-NEXT: ldr x0, [x0, :got_lo12:.Lfun0$local]
49 ; CHECK-NEXT: adrp x8, :got:fun1
50 ; CHECK-NEXT: ldr x8, [x8, :got_lo12:fun1]
51 ; CHECK-NEXT: //NO_APP
54 %0 = tail call i64 asm "adrp $0, :got:$1\0Aldr $0, [$0, :got_lo12:$1]\0Aadrp x8, :got:$2\0Aldr x8, [x8, :got_lo12:$2]", "=r,S,S,~{x8}"(ptr nonnull @fun0, ptr nonnull @fun1)