1 ; RUN: llc < %s -emulated-tls -relocation-model=pic -mtriple=i686-unknown-linux-gnu -fast-isel | FileCheck %s
2 ; RUN: llc < %s -relocation-model=pic -mtriple=i686-unknown-linux-gnu -fast-isel \
3 ; RUN: | FileCheck -check-prefix=NoEMU %s
4 ; RUN: llc < %s -relocation-model=pic -mtriple=i686-linux-android29 -fast-isel \
5 ; RUN: | FileCheck -check-prefix=NoEMU %s
10 @v = thread_local global i32 0
11 define i32 @f() nounwind {
19 ; CHECK: movl __emutls_v.v@GOT(%ebx), %eax
20 ; CHECK-NEXT: movl %eax, (%esp)
21 ; CHECK-NEXT: calll __emutls_get_address@PLT
22 ; CHECK-NEXT: movl (%eax), %eax
24 @alias = internal alias i32, ptr @v
25 define i32 @f_alias() nounwind {
32 ; CHECK-LABEL: f_alias:
33 ; CHECK: movl __emutls_v.v@GOT(%ebx), %eax
34 ; CHECK-NEXT: movl %eax, (%esp)
35 ; CHECK-NEXT: calll __emutls_get_address@PLT
36 ; CHECK-NEXT: movl (%eax), %eax
38 ; Use my_emutls_get_address like __emutls_get_address.
39 @my_emutls_v_xyz = external global ptr, align 4
40 declare ptr @my_emutls_get_address(ptr)
42 define i32 @my_get_xyz() {
44 %call = call ptr @my_emutls_get_address(ptr @my_emutls_v_xyz)
45 %0 = load i32, ptr %call, align 4
49 ; CHECK-LABEL: my_get_xyz:
50 ; CHECK: movl my_emutls_v_xyz@GOT(%ebx), %eax
51 ; CHECK-NEXT: movl %eax, (%esp)
52 ; CHECK-NEXT: calll my_emutls_get_address@PLT
53 ; CHECK-NEXT: movl (%eax), %eax