1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=x86_64 -relocation-model=static < %s | \
3 ; RUN: FileCheck --check-prefixes=COMMON,STATIC %s
4 ; RUN: llc -mtriple=x86_64 -relocation-model=pic < %s | \
5 ; RUN: FileCheck --check-prefixes=COMMON,CHECK %s
7 ;; Test that we use the local alias for dso_local functions in inline assembly.
9 @gv0 = dso_local global i32 0
10 @gv1 = dso_preemptable global i32 1
12 define i64 @test_var() nounwind {
13 ; STATIC-LABEL: test_var:
14 ; STATIC: # %bb.0: # %entry
15 ; STATIC-NEXT: movq gv1@GOTPCREL(%rip), %rax
17 ; STATIC-NEXT: movq gv0(%rip), %rax
18 ; STATIC-NEXT: movq (%rax), %rax
19 ; STATIC-NEXT: #NO_APP
22 ; CHECK-LABEL: test_var:
23 ; CHECK: # %bb.0: # %entry
24 ; CHECK-NEXT: movq gv1@GOTPCREL(%rip), %rax
26 ; CHECK-NEXT: movq .Lgv0$local(%rip), %rax
27 ; CHECK-NEXT: movq (%rax), %rax
31 %0 = tail call i64 asm "movq $1, $0\0Amovq $2, $0", "=r,*m,*m"(ptr elementtype(i32) @gv0, ptr elementtype(i32) @gv1)
35 define dso_local void @fun0() nounwind {
37 ; COMMON: # %bb.0: # %entry
43 define dso_preemptable void @fun1() nounwind {
45 ; COMMON: # %bb.0: # %entry
51 define i64 @test_fun() nounwind {
52 ; STATIC-LABEL: test_fun:
53 ; STATIC: # %bb.0: # %entry
54 ; STATIC-NEXT: movq fun1@GOTPCREL(%rip), %rax
56 ; STATIC-NEXT: movq fun0(%rip), %rax
57 ; STATIC-NEXT: movq (%rax), %rax
58 ; STATIC-NEXT: #NO_APP
61 ; CHECK-LABEL: test_fun:
62 ; CHECK: # %bb.0: # %entry
63 ; CHECK-NEXT: movq fun1@GOTPCREL(%rip), %rax
65 ; CHECK-NEXT: movq .Lfun0$local(%rip), %rax
66 ; CHECK-NEXT: movq (%rax), %rax
70 %0 = tail call i64 asm "movq $1, $0\0Amovq $2, $0", "=r,*m,*m"(ptr elementtype(void ()) nonnull @fun0, ptr elementtype(void ()) nonnull @fun1)