blob: a529646b88fc3cafba7d0b631066f112d541462f [file] [log] [blame]
Chih-Hung Hsieh9843f402015-07-28 17:32:49 +00001; 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
Chih-Hung Hsieh9f9e4682018-02-28 17:48:55 +00006; 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
10
Chih-Hung Hsieh9843f402015-07-28 17:32:49 +000011; Make sure that TLS symbols are emitted in expected order.
12
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
16
17define i32* @get_external_x() {
18entry:
19 ret i32* @external_x
20}
21
22define i8* @get_external_y() {
23entry:
24 ret i8* @external_y
25}
26
27define i64* @get_internal_y() {
28entry:
29 ret i64* @internal_y
30}
31
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:
Rafael Espindola449711c2015-11-18 06:02:15 +000038; MIPS_32: .data
Dan Gohman61d15ae2016-01-26 00:03:25 +000039; MIPS_32: .p2align 2
Chih-Hung Hsieh9843f402015-07-28 17:32:49 +000040; 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
Rafael Espindola449711c2015-11-18 06:02:15 +000044; MIPS_32: .data
Dan Gohman61d15ae2016-01-26 00:03:25 +000045; MIPS_32: .p2align 2
Chih-Hung Hsieh9843f402015-07-28 17:32:49 +000046; 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
53
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
Rafael Espindola449711c2015-11-18 06:02:15 +000066; MIPS_64: .data
Dan Gohman61d15ae2016-01-26 00:03:25 +000067; MIPS_64: .p2align 3
Chih-Hung Hsieh9843f402015-07-28 17:32:49 +000068; 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