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 ; Make sure that TLS symbols are emitted in expected order.
8 @external_x = external thread_local global i32, align 8
9 @external_y = thread_local global i8 7, align 2
10 @internal_y = internal thread_local global i64 9, align 16
12 define i32* @get_external_x() {
17 define i8* @get_external_y() {
22 define i64* @get_internal_y() {
27 ; MIPS_32-LABEL: get_external_y:
28 ; MIPS_32-LABEL: get_internal_y:
29 ; MIPS_32: lw {{.+}}(__emutls_v.internal_y
30 ; MIPS_32: lw {{.+}}call16(__emutls_get_address
31 ; MIPS_32-NOT: __emutls_t.external_x
32 ; MIPS_32-NOT: __emutls_v.external_x:
33 ; MIPS_32: .section .data.rel.local
35 ; MIPS_32-LABEL: __emutls_v.external_y:
36 ; MIPS_32: .section .rodata,
37 ; MIPS_32-LABEL: __emutls_t.external_y:
38 ; MIPS_32-NEXT: .byte 7
39 ; MIPS_32: .section .data.rel.local
41 ; MIPS_32-LABEL: __emutls_v.internal_y:
42 ; MIPS_32-NEXT: .4byte 8
43 ; MIPS_32-NEXT: .4byte 16
44 ; MIPS_32-NEXT: .4byte 0
45 ; MIPS_32-NEXT: .4byte __emutls_t.internal_y
46 ; MIPS_32-LABEL: __emutls_t.internal_y:
47 ; MIPS_32-NEXT: .8byte 9
49 ; MIPS_64-LABEL: get_external_x:
50 ; MIPS_64-LABEL: get_external_y:
51 ; MIPS_64-LABEL: get_internal_y:
52 ; MIPS_64: ld {{.+}}(__emutls_v.internal_y
53 ; MIPS_64: ld {{.+}}call16(__emutls_get_address
54 ; MIPS_64-NOT: __emutls_t.external_x
55 ; MIPS_64-NOT: __emutls_v.external_x:
56 ; MIPS_64-LABEL: __emutls_v.external_y:
57 ; MIPS_64-NOT: __emutls_v.external_x:
58 ; MIPS_64: .section .rodata,
59 ; MIPS_64-LABEL: __emutls_t.external_y:
60 ; MIPS_64-NEXT: .byte 7
61 ; MIPS_64: .section .data.rel.local
63 ; MIPS_64-LABEL: __emutls_v.internal_y:
64 ; MIPS_64-NEXT: .8byte 8
65 ; MIPS_64-NEXT: .8byte 16
66 ; MIPS_64-NEXT: .8byte 0
67 ; MIPS_64-NEXT: .8byte __emutls_t.internal_y
68 ; MIPS_64: .section .rodata,
69 ; MIPS_64-LABEL: __emutls_t.internal_y:
70 ; MIPS_64-NEXT: .8byte 9