brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.2 KiB · 048c7fb Raw
155 lines · plain
1; RUN: llc < %s -emulated-tls -mcpu=generic -mtriple=i386-linux-gnu -relocation-model=pic \2; RUN:   | FileCheck -check-prefix=X86 %s3; RUN: llc < %s -emulated-tls -mcpu=generic -mtriple=x86_64-linux-gnu -relocation-model=pic \4; RUN:   | FileCheck -check-prefix=X64 %s5; RUN: llc < %s -emulated-tls -mcpu=generic -mtriple=i386-linux-android -relocation-model=pic \6; RUN:   | FileCheck -check-prefix=X86 %s7; RUN: llc < %s -emulated-tls -mcpu=generic -mtriple=x86_64-linux-android -relocation-model=pic \8; RUN:   | FileCheck -check-prefix=X64 %s9 10; RUN: llc < %s -mcpu=generic -mtriple=i386-linux-gnu -relocation-model=pic \11; RUN:   | FileCheck -check-prefix=NoEMU %s12; RUN: llc < %s -mcpu=generic -mtriple=x86_64-linux-gnu -relocation-model=pic \13; RUN:   | FileCheck -check-prefix=NoEMU %s14; RUN: llc < %s -mcpu=generic -mtriple=i386-linux-android29 -relocation-model=pic \15; RUN:   | FileCheck -check-prefix=NoEMU %s16; RUN: llc < %s -mcpu=generic -mtriple=i386-linux-android -relocation-model=pic \17; RUN:   | FileCheck -check-prefix=X86 %s18; RUN: llc < %s -mcpu=generic -mtriple=x86_64-linux-android -relocation-model=pic \19; RUN:   | FileCheck -check-prefix=X64 %s20 21; NoEMU-NOT: __emutls22 23; Use my_emutls_get_address like __emutls_get_address.24@my_emutls_v_xyz = external global ptr, align 425declare ptr @my_emutls_get_address(ptr)26 27define dso_local i32 @my_get_xyz() {28; X86-LABEL: my_get_xyz:29; X86:      movl my_emutls_v_xyz@GOT(%ebx), %eax30; X86-NEXT: movl %eax, (%esp)31; X86-NEXT: calll my_emutls_get_address@PLT32; X86-NEXT: movl (%eax), %eax33; X86-NEXT: addl $8, %esp34; X86-NEXT: .cfi_def_cfa_offset 835; X86-NEXT: popl %ebx36; X86-NEXT: .cfi_def_cfa_offset 437; X86-NEXT: retl38; X64-LABEL: my_get_xyz:39; X64:      movq my_emutls_v_xyz@GOTPCREL(%rip), %rdi40; X64-NEXT: callq my_emutls_get_address@PLT41; X64-NEXT: movl (%rax), %eax42; X64-NEXT: popq %rcx43; X64-NEXT: .cfi_def_cfa_offset 844; X64-NEXT: retq45 46entry:47  %call = call ptr @my_emutls_get_address(ptr @my_emutls_v_xyz)48  %0 = load i32, ptr %call, align 449  ret i32 %050}51 52@i = dso_local thread_local global i32 1553@i2 = external thread_local global i3254 55define dso_local i32 @f1() {56; X86-LABEL: f1:57; X86:      leal __emutls_v.i@GOTOFF(%ebx), %eax58; X86-NEXT: movl %eax, (%esp)59; X86-NEXT: calll __emutls_get_address@PLT60; X86-NEXT: movl (%eax), %eax61; X86-NEXT: addl $8, %esp62; X86-NEXT: .cfi_def_cfa_offset 863; X86-NEXT: popl %ebx64; X86-NEXT: .cfi_def_cfa_offset 465; X86-NEXT: retl66; X64-LABEL: f1:67; X64:      leaq __emutls_v.i(%rip), %rdi68; X64-NEXT: callq __emutls_get_address@PLT69; X64-NEXT: movl (%rax), %eax70; X64-NEXT: popq %rcx71; X64-NEXT: .cfi_def_cfa_offset 872; X64-NEXT: retq73 74entry:75  %tmp1 = load i32, ptr @i76  ret i32 %tmp177}78 79define dso_local ptr @f2() {80; X86-LABEL: f2:81; X86:      leal __emutls_v.i@GOTOFF(%ebx), %eax82; X86-NEXT: movl %eax, (%esp)83; X86-NEXT: calll __emutls_get_address@PLT84; X64-LABEL: f2:85; X64:      leaq __emutls_v.i(%rip), %rdi86; X64-NEXT: callq __emutls_get_address@PLT87 88entry:89  ret ptr @i90}91 92define dso_local i32 @f3() {93; X86-LABEL: f3:94; X86:      movl __emutls_v.i2@GOT(%ebx), %eax95; X86-NEXT: movl %eax, (%esp)96; X86-NEXT: calll __emutls_get_address@PLT97; X64-LABEL: f3:98; X64:      movq __emutls_v.i2@GOTPCREL(%rip), %rdi99; X64-NEXT: callq __emutls_get_address@PLT100 101entry:102  %tmp1 = load i32, ptr @i2103  ret i32 %tmp1104}105 106define dso_local ptr @f4() {107; X86-LABEL: f4:108; X86:      movl __emutls_v.i2@GOT(%ebx), %eax109; X86-NEXT: movl %eax, (%esp)110; X86-NEXT: calll __emutls_get_address@PLT111; X64-LABEL: f4:112; X64:      movq __emutls_v.i2@GOTPCREL(%rip), %rdi113; X64-NEXT: callq __emutls_get_address@PLT114 115entry:116  ret ptr @i2117}118 119;;;;; 32-bit targets120 121; X86:      .data122; X86-LABEL: __emutls_v.i:123; X86-NEXT: .long 4124; X86-NEXT: .long 4125; X86-NEXT: .long 0126; X86-NEXT: .long __emutls_t.i127 128; X86:      .section .rodata,129; X86-LABEL: __emutls_t.i:130; X86-NEXT: .long 15131 132; X86-NOT:   __emutls_v.i2133; X86-NOT:   __emutls_t.i2134 135;;;;; 64-bit targets136 137; X64:      .data138; X64-LABEL: __emutls_v.i:139; X64-NEXT: .quad 4140; X64-NEXT: .quad 4141; X64-NEXT: .quad 0142; X64-NEXT: .quad __emutls_t.i143 144; X64:      .section .rodata,145; X64-LABEL: __emutls_t.i:146; X64-NEXT: .long 15147 148; X64-NOT:   __emutls_v.i2149; X64-NOT:   __emutls_t.i2150 151 152!llvm.module.flags = !{!0, !1}153!0 = !{i32 1, !"PIC Level", i32 1}154!1 = !{i32 1, !"PIE Level", i32 1}155