9f6195f69662a238315c9ab3d712ee42bee53b01
[oota-llvm.git] / test / CodeGen / PowerPC / emutls_generic.ll
1 ; RUN: llc < %s -emulated-tls -march=ppc64 -relocation-model=pic \
2 ; RUN:     | FileCheck %s
3 ; RUN: llc < %s -emulated-tls -march=ppc32 -relocation-model=pic \
4 ; RUN:     | FileCheck %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 ; CHECK-LABEL: get_external_x:
28 ; CHECK-NOT:   _tls_get_address
29 ; CHECK:       __emutls_get_address
30 ; CHECK-LABEL: get_external_y:
31 ; CHECK:       __emutls_get_address
32 ; CHECK-NOT:   _tls_get_address
33 ; CHECK-LABEL: get_internal_y:
34 ; CHECK-NOT:   __emutls_t.external_x:
35 ; CHECK-NOT:   __emutls_v.external_x:
36 ; CHECK-LABEL: __emutls_v.external_y:
37 ; CHECK-LABEL: __emutls_t.external_y:
38 ; CHECK:       __emutls_t.external_y
39 ; CHECK-LABEL: __emutls_v.internal_y:
40 ; CHECK-LABEL: __emutls_t.internal_y:
41 ; CHECK:       __emutls_t.internal_y