blob: 9a73a715f02e18b921cad3245685819d4c9367d9 [file] [log] [blame]
Chih-Hung Hsiehc5e53ca2015-07-28 20:31:10 +00001; RUN: llc < %s -emulated-tls -mtriple=powerpc64-unknown-linux-gnu -relocation-model=pic \
Chih-Hung Hsieh9843f402015-07-28 17:32:49 +00002; RUN: | FileCheck %s
Chih-Hung Hsieh41169c52015-07-28 20:38:29 +00003; RUN: llc < %s -emulated-tls -mtriple=powerpc-unknown-linux-gnu -relocation-model=pic \
Chih-Hung Hsieh9843f402015-07-28 17:32:49 +00004; RUN: | FileCheck %s
5
Chih-Hung Hsieh9f9e4682018-02-28 17:48:55 +00006; RUN: llc < %s -mtriple=powerpc64-unknown-linux-gnu -relocation-model=pic \
7; RUN: | FileCheck -check-prefix=NoEMU %s
8; RUN: llc < %s -mtriple=powerpc-unknown-linux-gnu -relocation-model=pic \
9; RUN: | FileCheck -check-prefix=NoEMU %s
10
11; NoEMU-NOT: __emutls
12
Chih-Hung Hsieh9843f402015-07-28 17:32:49 +000013; Make sure that TLS symbols are emitted in expected order.
14
15@external_x = external thread_local global i32, align 8
16@external_y = thread_local global i8 7, align 2
17@internal_y = internal thread_local global i64 9, align 16
18
19define i32* @get_external_x() {
20entry:
21 ret i32* @external_x
22}
23
24define i8* @get_external_y() {
25entry:
26 ret i8* @external_y
27}
28
29define i64* @get_internal_y() {
30entry:
31 ret i64* @internal_y
32}
33
34; CHECK-LABEL: get_external_x:
35; CHECK-NOT: _tls_get_address
36; CHECK: __emutls_get_address
37; CHECK-LABEL: get_external_y:
38; CHECK: __emutls_get_address
39; CHECK-NOT: _tls_get_address
40; CHECK-LABEL: get_internal_y:
41; CHECK-NOT: __emutls_t.external_x:
42; CHECK-NOT: __emutls_v.external_x:
43; CHECK-LABEL: __emutls_v.external_y:
44; CHECK-LABEL: __emutls_t.external_y:
45; CHECK: __emutls_t.external_y
46; CHECK-LABEL: __emutls_v.internal_y:
47; CHECK-LABEL: __emutls_t.internal_y:
48; CHECK: __emutls_t.internal_y