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 5 6 ; Make sure that TLS symbols are emitted in expected order. 7 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 11 12 define i32* @get_external_x() { 13 entry: 14 ret i32* @external_x 15 } 16 17 define i8* @get_external_y() { 18 entry: 19 ret i8* @external_y 20 } 21 22 define i64* @get_internal_y() { 23 entry: 24 ret i64* @internal_y 25 } 26 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: .data 34 ; MIPS_32: .align 2 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: .data 40 ; MIPS_32: .align 2 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 48 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: .data 62 ; MIPS_64: .align 3 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 71