1 ; RUN: llc < %s -emulated-tls -mtriple=mipsel-linux-android -relocation-model=pic \
2 ; RUN: | FileCheck -check-prefix=MIPS_32 %s
3 ; RUN: llc < %s -emulated-tls -mtriple=mips64el-linux-android -relocation-model=pic \
4 ; RUN: | FileCheck -check-prefix=MIPS_64 %s
6 ; RUN: llc < %s -mtriple=mipsel-linux-android -relocation-model=pic \
7 ; RUN: | FileCheck -check-prefix=MIPS_32 %s
8 ; RUN: llc < %s -mtriple=mips64el-linux-android -relocation-model=pic \
9 ; RUN: | FileCheck -check-prefix=MIPS_64 %s
11 ; Make sure that TLS symbols are emitted in expected order.
13 @external_x = external thread_local global i32, align 8
14 @external_y = thread_local global i8 7, align 2
15 @internal_y = internal thread_local global i64 9, align 16
17 define i32* @get_external_x() {
22 define i8* @get_external_y() {
27 define i64* @get_internal_y() {
32 ; MIPS_32-LABEL: get_external_y:
33 ; MIPS_32-LABEL: get_internal_y:
34 ; MIPS_32: lw {{.+}}(__emutls_v.internal_y
35 ; MIPS_32: lw {{.+}}call16(__emutls_get_address
36 ; MIPS_32-NOT: __emutls_t.external_x
37 ; MIPS_32-NOT: __emutls_v.external_x:
40 ; MIPS_32-LABEL: __emutls_v.external_y:
41 ; MIPS_32: .section .rodata,
42 ; MIPS_32-LABEL: __emutls_t.external_y:
43 ; MIPS_32-NEXT: .byte 7
46 ; MIPS_32-LABEL: __emutls_v.internal_y:
47 ; MIPS_32-NEXT: .4byte 8
48 ; MIPS_32-NEXT: .4byte 16
49 ; MIPS_32-NEXT: .4byte 0
50 ; MIPS_32-NEXT: .4byte __emutls_t.internal_y
51 ; MIPS_32-LABEL: __emutls_t.internal_y:
52 ; MIPS_32-NEXT: .8byte 9
54 ; MIPS_64-LABEL: get_external_x:
55 ; MIPS_64-LABEL: get_external_y:
56 ; MIPS_64-LABEL: get_internal_y:
57 ; MIPS_64: ld {{.+}}(__emutls_v.internal_y
58 ; MIPS_64: ld {{.+}}call16(__emutls_get_address
59 ; MIPS_64-NOT: __emutls_t.external_x
60 ; MIPS_64-NOT: __emutls_v.external_x:
61 ; MIPS_64-LABEL: __emutls_v.external_y:
62 ; MIPS_64-NOT: __emutls_v.external_x:
63 ; MIPS_64: .section .rodata,
64 ; MIPS_64-LABEL: __emutls_t.external_y:
65 ; MIPS_64-NEXT: .byte 7
68 ; MIPS_64-LABEL: __emutls_v.internal_y:
69 ; MIPS_64-NEXT: .8byte 8
70 ; MIPS_64-NEXT: .8byte 16
71 ; MIPS_64-NEXT: .8byte 0
72 ; MIPS_64-NEXT: .8byte __emutls_t.internal_y
73 ; MIPS_64: .section .rodata,
74 ; MIPS_64-LABEL: __emutls_t.internal_y:
75 ; MIPS_64-NEXT: .8byte 9