1 ; RUN: llc < %s -emulated-tls -march=x86 -mtriple=x86_64-linux-android -relocation-model=pic | FileCheck %s 2 ; RUN: llc < %s -emulated-tls -march=x86-64 -mtriple=x86_64-linux-android -relocation-model=pic | FileCheck -check-prefix=X64 %s 3 4 ; Make sure that TLS symboles are emitted in expected order. 5 6 @external_x = external thread_local global i32 7 @external_y = thread_local global i32 7 8 @internal_y = internal thread_local global i32 9 9 10 define i32* @get_external_x() { 11 entry: 12 ret i32* @external_x 13 } 14 15 define i32* @get_external_y() { 16 entry: 17 ret i32* @external_y 18 } 19 20 define i32* @get_internal_y() { 21 entry: 22 ret i32* @internal_y 23 } 24 25 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 32-bit mode 26 ; CHECK-LABEL: get_external_x: 27 ; CHECK: __emutls_v.external_x 28 ; CHECK: __emutls_get_address 29 30 ; CHECK-LABEL: get_external_y: 31 ; CHECK: __emutls_v.external_y 32 ; CHECK: __emutls_get_address 33 34 ; CHECK-LABEL: get_internal_y: 35 ; CHECK: __emutls_v.internal_y 36 ; CHECK: __emutls_get_address 37 38 ; CHECK-NOT: __emutls_v.external_x: 39 40 ; CHECK: .align 4 41 ; CHECK-LABEL: __emutls_v.external_y: 42 ; CHECK-NEXT: .long 4 43 ; CHECK-NEXT: .long 4 44 ; CHECK-NEXT: .long 0 45 ; CHECK-NEXT: .long __emutls_t.external_y 46 ; CHECK-LABEL: __emutls_t.external_y: 47 ; CHECK-NEXT: .long 7 48 49 ; CHECK: .align 4 50 ; CHECK-LABEL: __emutls_v.internal_y: 51 ; CHECK-NEXT: .long 4 52 ; CHECK-NEXT: .long 4 53 ; CHECK-NEXT: .long 0 54 ; CHECK-NEXT: .long __emutls_t.internal_y 55 ; CHECK-LABEL: __emutls_t.internal_y: 56 ; CHECK-NEXT: .long 9 57 58 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 64-bit mode 59 ; X64-LABEL: get_external_x: 60 ; X64: __emutls_v.external_x 61 ; X64: __emutls_get_address 62 63 ; X64-LABEL: get_external_y: 64 ; X64: __emutls_v.external_y 65 ; X64: __emutls_get_address 66 67 ; X64-LABEL: get_internal_y: 68 ; X64: __emutls_v.internal_y 69 ; X64: __emutls_get_address 70 71 ; X64-NOT: __emutls_v.external_x: 72 73 ; X64: .align 8 74 ; X64-LABEL: __emutls_v.external_y: 75 ; X64-NEXT: .quad 4 76 ; X64-NEXT: .quad 4 77 ; X64-NEXT: .quad 0 78 ; X64-NEXT: .quad __emutls_t.external_y 79 ; X64-LABEL: __emutls_t.external_y: 80 ; X64-NEXT: .long 7 81 82 ; X64: .align 8 83 ; X64-LABEL: __emutls_v.internal_y: 84 ; X64-NEXT: .quad 4 85 ; X64-NEXT: .quad 4 86 ; X64-NEXT: .quad 0 87 ; X64-NEXT: .quad __emutls_t.internal_y 88 ; X64-LABEL: __emutls_t.internal_y: 89 ; X64-NEXT: .long 9 90