1 ; RUN: llc < %s -emulated-tls -mtriple=i686-linux-android -relocation-model=pic \
2 ; RUN: | FileCheck -check-prefix=X86_32 %s
3 ; RUN: llc < %s -emulated-tls -mtriple=i686-linux-android -relocation-model=pic \
4 ; RUN: | FileCheck -check-prefix=X86_32 %s
5 ; RUN: llc < %s -emulated-tls -mtriple=x86_64-linux-android -relocation-model=pic \
6 ; RUN: | FileCheck -check-prefix=X86_64 %s
7 ; RUN: llc < %s -emulated-tls -mtriple=i386-linux-gnu -relocation-model=pic \
10 ; RUN: llc < %s -mtriple=i686-linux-android -relocation-model=pic \
11 ; RUN: | FileCheck -check-prefix=X86_32 %s
12 ; RUN: llc < %s -mtriple=i686-linux-android -relocation-model=pic \
13 ; RUN: | FileCheck -check-prefix=X86_32 %s
14 ; RUN: llc < %s -mtriple=x86_64-linux-android -relocation-model=pic \
15 ; RUN: | FileCheck -check-prefix=X86_64 %s
16 ; RUN: llc < %s -mtriple=i386-linux-gnu -relocation-model=pic \
17 ; RUN: | FileCheck -check-prefix=NoEMU %s
21 ; Make sure that TLS symbols are emitted in expected order.
23 @external_x = external thread_local global i32, align 8
24 @external_y = thread_local global i8 7, align 2
25 @internal_y = internal thread_local global i64 9, align 16
27 define i32* @get_external_x() {
32 define i8* @get_external_y() {
37 define i64* @get_internal_y() {
42 ; CHECK-LABEL: get_external_x:
43 ; CHECK-NOT: _tls_get_address
44 ; CHECK: __emutls_get_address
45 ; CHECK-LABEL: get_external_y:
46 ; CHECK: __emutls_get_address
47 ; CHECK-NOT: _tls_get_address
48 ; CHECK-LABEL: get_internal_y:
49 ; CHECK-NOT: __emutls_t.external_x:
50 ; CHECK-NOT: __emutls_v.external_x:
51 ; CHECK-LABEL: __emutls_v.external_y:
52 ; CHECK-LABEL: __emutls_t.external_y:
53 ; CHECK: __emutls_t.external_y
54 ; CHECK-LABEL: __emutls_v.internal_y:
55 ; CHECK-LABEL: __emutls_t.internal_y:
56 ; CHECK: __emutls_t.internal_y
58 ; X86_32-LABEL: get_external_x:
59 ; X86_32: movl __emutls_v.external_x@GOT(%ebx)
60 ; X86_32: calll __emutls_get_address
61 ; X86_32-LABEL: get_external_y:
62 ; X86_32: movl __emutls_v.external_y@GOT(%ebx)
63 ; X86_32: calll __emutls_get_address
64 ; X86_32-LABEL: get_internal_y:
65 ; X86_32: leal __emutls_v.internal_y@GOTOFF(%ebx)
66 ; X86_32: calll __emutls_get_address
67 ; X86_32-NOT: __emutls_t.external_x
68 ; X86_32-NOT: __emutls_v.external_x:
70 ; X86_32: .globl __emutls_v.external_y
72 ; X86_32-LABEL: __emutls_v.external_y:
73 ; X86_32-NEXT: .long 1
74 ; X86_32-NEXT: .long 2
75 ; X86_32-NEXT: .long 0
76 ; X86_32-NEXT: .long __emutls_t.external_y
77 ; X86_32: .section .rodata,
78 ; X86_32-LABEL: __emutls_t.external_y:
79 ; X86_32-NEXT: .byte 7
83 ; X86_32-LABEL: __emutls_v.internal_y:
84 ; X86_32-NEXT: .long 8
85 ; X86_32-NEXT: .long 16
86 ; X86_32-NEXT: .long 0
87 ; X86_32-NEXT: .long __emutls_t.internal_y
88 ; X86_32-LABEL: __emutls_t.internal_y:
89 ; X86_32-NEXT: .quad 9
90 ; X86_64-LABEL: get_external_x:
91 ; X86_64: __emutls_v.external_x@GOTPCREL(%rip)
92 ; X86_64: __emutls_get_address
93 ; X86_64-LABEL: get_external_y:
94 ; X86_64: __emutls_v.external_y@GOTPCREL(%rip)
95 ; X86_64: __emutls_get_address
96 ; X86_64-LABEL: get_internal_y:
97 ; X86_64: __emutls_v.internal_y(%rip)
98 ; X86_64: __emutls_get_address
99 ; X86_64-NOT: __emutls_t.external_x
100 ; X86_64-NOT: __emutls_v.external_x:
101 ; X86_64: .globl __emutls_v.external_y
103 ; X86_64-LABEL: __emutls_v.external_y:
104 ; X86_64-NEXT: .quad 1
105 ; X86_64-NEXT: .quad 2
106 ; X86_64-NEXT: .quad 0
107 ; X86_64-NEXT: .quad __emutls_t.external_y
108 ; X86_64-NOT: __emutls_v.external_x:
109 ; X86_64: .section .rodata,
110 ; X86_64-LABEL: __emutls_t.external_y:
111 ; X86_64-NEXT: .byte 7
115 ; X86_64-LABEL: __emutls_v.internal_y:
116 ; X86_64-NEXT: .quad 8
117 ; X86_64-NEXT: .quad 16
118 ; X86_64-NEXT: .quad 0
119 ; X86_64-NEXT: .quad __emutls_t.internal_y
120 ; X86_64: .section .rodata,
121 ; X86_64-LABEL: __emutls_t.internal_y:
122 ; X86_64-NEXT: .quad 9