brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · 4ce00f5 Raw
54 lines · plain
1; RUN: llc < %s -emulated-tls -relocation-model=pic -mtriple=i686-unknown-linux-gnu -fast-isel | FileCheck %s2; RUN: llc < %s -relocation-model=pic -mtriple=i686-unknown-linux-gnu -fast-isel \3; RUN: | FileCheck -check-prefix=NoEMU %s4; RUN: llc < %s -relocation-model=pic -mtriple=i686-linux-android29 -fast-isel \5; RUN: | FileCheck -check-prefix=NoEMU %s6; PR36547 8; NoEMU-NOT: __emutls9 10@v = thread_local global i32 011define i32 @f() nounwind {12entry:13          %t = load i32, ptr @v14          %s = add i32 %t, 115          ret i32 %s16}17 18; CHECK-LABEL: f:19; CHECK:      movl __emutls_v.v@GOT(%ebx), %eax20; CHECK-NEXT: movl %eax, (%esp)21; CHECK-NEXT: calll __emutls_get_address@PLT22; CHECK-NEXT: movl (%eax), %eax23 24@alias = internal alias i32, ptr @v25define i32 @f_alias() nounwind {26entry:27          %t = load i32, ptr @v28          %s = add i32 %t, 129          ret i32 %s30}31 32; CHECK-LABEL: f_alias:33; CHECK:      movl __emutls_v.v@GOT(%ebx), %eax34; CHECK-NEXT: movl %eax, (%esp)35; CHECK-NEXT: calll __emutls_get_address@PLT36; CHECK-NEXT: movl (%eax), %eax37 38; Use my_emutls_get_address like __emutls_get_address.39@my_emutls_v_xyz = external global ptr, align 440declare ptr @my_emutls_get_address(ptr)41 42define i32 @my_get_xyz() {43entry:44  %call = call ptr @my_emutls_get_address(ptr @my_emutls_v_xyz)45  %0 = load i32, ptr %call, align 446  ret i32 %047}48 49; CHECK-LABEL: my_get_xyz:50; CHECK:      movl my_emutls_v_xyz@GOT(%ebx), %eax51; CHECK-NEXT: movl %eax, (%esp)52; CHECK-NEXT: calll my_emutls_get_address@PLT53; CHECK-NEXT: movl (%eax), %eax54