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
18 ; RUN: llc < %s -mtriple=i686-linux-android29 -relocation-model=pic \
19 ; RUN: | FileCheck -check-prefix=NoEMU %s
23 ; Make sure that TLS symbols are emitted in expected order.
25 @external_x = external thread_local global i32, align 8
26 @external_y = thread_local global i8 7, align 2
27 @internal_y = internal thread_local global i64 9, align 16
29 define ptr @get_external_x() {
34 define ptr @get_external_y() {
39 define ptr @get_internal_y() {
44 ; CHECK-LABEL: get_external_x:
45 ; CHECK-NOT: _tls_get_address
46 ; CHECK: __emutls_get_address
47 ; CHECK-LABEL: get_external_y:
48 ; CHECK: __emutls_get_address
49 ; CHECK-NOT: _tls_get_address
50 ; CHECK-LABEL: get_internal_y:
51 ; CHECK-NOT: __emutls_t.external_x:
52 ; CHECK-NOT: __emutls_v.external_x:
53 ; CHECK-LABEL: __emutls_v.external_y:
54 ; CHECK-LABEL: __emutls_t.external_y:
55 ; CHECK: __emutls_t.external_y
56 ; CHECK-LABEL: __emutls_v.internal_y:
57 ; CHECK-LABEL: __emutls_t.internal_y:
58 ; CHECK: __emutls_t.internal_y
60 ; X86_32-LABEL: get_external_x:
61 ; X86_32: movl __emutls_v.external_x@GOT(%ebx)
62 ; X86_32: calll __emutls_get_address
63 ; X86_32-LABEL: get_external_y:
64 ; X86_32: movl __emutls_v.external_y@GOT(%ebx)
65 ; X86_32: calll __emutls_get_address
66 ; X86_32-LABEL: get_internal_y:
67 ; X86_32: leal __emutls_v.internal_y@GOTOFF(%ebx)
68 ; X86_32: calll __emutls_get_address
69 ; X86_32-NOT: __emutls_t.external_x
70 ; X86_32-NOT: __emutls_v.external_x:
72 ; X86_32: .globl __emutls_v.external_y
74 ; X86_32-LABEL: __emutls_v.external_y:
75 ; X86_32-NEXT: .long 1
76 ; X86_32-NEXT: .long 2
77 ; X86_32-NEXT: .long 0
78 ; X86_32-NEXT: .long __emutls_t.external_y
79 ; X86_32: .section .rodata,
80 ; X86_32-LABEL: __emutls_t.external_y:
81 ; X86_32-NEXT: .byte 7
85 ; X86_32-LABEL: __emutls_v.internal_y:
86 ; X86_32-NEXT: .long 8
87 ; X86_32-NEXT: .long 16
88 ; X86_32-NEXT: .long 0
89 ; X86_32-NEXT: .long __emutls_t.internal_y
90 ; X86_32-LABEL: __emutls_t.internal_y:
91 ; X86_32-NEXT: .quad 9
92 ; X86_64-LABEL: get_external_x:
93 ; X86_64: __emutls_v.external_x@GOTPCREL(%rip)
94 ; X86_64: __emutls_get_address
95 ; X86_64-LABEL: get_external_y:
96 ; X86_64: __emutls_v.external_y@GOTPCREL(%rip)
97 ; X86_64: __emutls_get_address
98 ; X86_64-LABEL: get_internal_y:
99 ; X86_64: __emutls_v.internal_y(%rip)
100 ; X86_64: __emutls_get_address
101 ; X86_64-NOT: __emutls_t.external_x
102 ; X86_64-NOT: __emutls_v.external_x:
103 ; X86_64: .globl __emutls_v.external_y
105 ; X86_64-LABEL: __emutls_v.external_y:
106 ; X86_64-NEXT: .quad 1
107 ; X86_64-NEXT: .quad 2
108 ; X86_64-NEXT: .quad 0
109 ; X86_64-NEXT: .quad __emutls_t.external_y
110 ; X86_64-NOT: __emutls_v.external_x:
111 ; X86_64: .section .rodata,
112 ; X86_64-LABEL: __emutls_t.external_y:
113 ; X86_64-NEXT: .byte 7
117 ; X86_64-LABEL: __emutls_v.internal_y:
118 ; X86_64-NEXT: .quad 8
119 ; X86_64-NEXT: .quad 16
120 ; X86_64-NEXT: .quad 0
121 ; X86_64-NEXT: .quad __emutls_t.internal_y
122 ; X86_64: .section .rodata,
123 ; X86_64-LABEL: __emutls_t.internal_y:
124 ; X86_64-NEXT: .quad 9