brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.6 KiB · fc57d99 Raw
184 lines · plain
1; RUN: llc < %s -emulated-tls -mtriple=i386-linux-gnu -relocation-model=pic | FileCheck -check-prefix=X86 %s2; RUN: llc < %s -emulated-tls -mtriple=x86_64-linux-gnu -relocation-model=pic | FileCheck -check-prefix=X64 %s3; RUN: llc < %s -emulated-tls -mtriple=i386-linux-android -relocation-model=pic | FileCheck -check-prefix=X86 %s4; RUN: llc < %s -emulated-tls -mtriple=x86_64-linux-android -relocation-model=pic | FileCheck -check-prefix=X64 %s5 6; RUN: llc < %s -mtriple=i386-linux-gnu -relocation-model=pic | FileCheck -check-prefix=NoEMU %s7; RUN: llc < %s -mtriple=x86_64-linux-gnu -relocation-model=pic | FileCheck -check-prefix=NoEMU %s8; RUN: llc < %s -mtriple=x86_64-linux-android29 -relocation-model=pic | FileCheck -check-prefix=NoEMU %s9; RUN: llc < %s -mtriple=i386-linux-android -relocation-model=pic | FileCheck -check-prefix=X86 %s10; RUN: llc < %s -mtriple=x86_64-linux-android -relocation-model=pic | FileCheck -check-prefix=X64 %s11; RUN: llc < %s -mtriple=i386-linux-ohos -relocation-model=pic | FileCheck -check-prefix=X86 %s12; RUN: llc < %s -mtriple=x86_64-linux-ohos -relocation-model=pic | FileCheck -check-prefix=X64 %s13 14; NoEMU-NOT: __emutls15 16; Use my_emutls_get_address like __emutls_get_address.17@my_emutls_v_xyz = external global ptr, align 418declare ptr @my_emutls_get_address(ptr)19 20define i32 @my_get_xyz() {21; X86-LABEL: my_get_xyz:22; X86:      movl my_emutls_v_xyz@GOT(%ebx), %eax23; X86-NEXT: movl %eax, (%esp)24; X86-NEXT: calll my_emutls_get_address@PLT25; X64-LABEL: my_get_xyz:26; X64:      movq my_emutls_v_xyz@GOTPCREL(%rip), %rdi27; X64-NEXT: callq my_emutls_get_address@PLT28; X64-NEXT: movl (%rax), %eax29 30entry:31  %call = call ptr @my_emutls_get_address(ptr @my_emutls_v_xyz)32  %0 = load i32, ptr %call, align 433  ret i32 %034}35 36@i = thread_local global i32 1537@j = internal thread_local global i32 4238@k = internal thread_local global i32 0, align 839 40define i32 @f1() {41entry:42  %tmp1 = load i32, ptr @i43  ret i32 %tmp144}45 46; X86-LABEL: f1:47; X86:      movl __emutls_v.i@GOT(%ebx), %eax48; X86-NEXT: movl %eax, (%esp)49; X86-NEXT: calll __emutls_get_address@PLT50; X64-LABEL: f1:51; X64:      movq __emutls_v.i@GOTPCREL(%rip), %rdi52; X64-NEXT: callq __emutls_get_address@PLT53; X64-NEXT: movl (%rax), %eax54 55@i2 = external thread_local global i3256 57define ptr @f2() {58entry:59  ret ptr @i60}61 62; X86-LABEL: f2:63; X64-LABEL: f2:64 65 66define i32 @f3() {67entry:68  %tmp1 = load i32, ptr @i  ; <i32> [#uses=1]69  ret i32 %tmp170}71 72; X86-LABEL: f3:73; X64-LABEL: f3:74 75 76define ptr @f4() nounwind {77entry:78  ret ptr @i79}80 81; X86-LABEL: f4:82; X64-LABEL: f4:83 84 85define i32 @f5() nounwind {86entry:87  %0 = load i32, ptr @j, align 488  %1 = load i32, ptr @k, align 489  %add = add nsw i32 %0, %190  ret i32 %add91}92 93; X86-LABEL: f5:94; X86:      leal __emutls_v.j@GOTOFF(%ebx), %eax95; X86-NEXT: movl %eax, (%esp)96; X86-NEXT: calll __emutls_get_address@PLT97; X86-NEXT: movl (%eax), %esi98; X86-NEXT: leal __emutls_v.k@GOTOFF(%ebx), %eax99; X86-NEXT: movl %eax, (%esp)100; X86-NEXT: calll __emutls_get_address@PLT101; X86-NEXT: addl (%eax), %esi102; X86-NEXT: movl %esi, %eax103 104; X64-LABEL: f5:105; X64:      leaq __emutls_v.j(%rip), %rdi106; X64-NEXT: callq __emutls_get_address@PLT107; X64-NEXT: movl (%rax), %ebx108; X64-NEXT: leaq __emutls_v.k(%rip), %rdi109; X64-NEXT: callq __emutls_get_address@PLT110; X64-NEXT: addl (%rax), %ebx111; X64-NEXT: movl %ebx, %eax112 113;;;;; 32-bit targets114 115; X86:      .data{{$}}116; X86:      .globl __emutls_v.i117; X86-LABEL: __emutls_v.i:118; X86-NEXT: .long 4119; X86-NEXT: .long 4120; X86-NEXT: .long 0121; X86-NEXT: .long __emutls_t.i122 123; X86:      .section .rodata,124; X86-LABEL: __emutls_t.i:125; X86-NEXT: .long 15126 127; X86:      .data{{$}}128; X86-NOT:  .globl129; X86-LABEL: __emutls_v.j:130; X86-NEXT: .long 4131; X86-NEXT: .long 4132; X86-NEXT: .long 0133; X86-NEXT: .long __emutls_t.j134 135; X86:      .section .rodata,136; X86-LABEL: __emutls_t.j:137; X86-NEXT: .long 42138 139; X86:      .data{{$}}140; X86-NOT:  .globl141; X86-LABEL: __emutls_v.k:142; X86-NEXT: .long 4143; X86-NEXT: .long 8144; X86-NEXT: .long 0145; X86-NEXT: .long 0146 147; X86-NOT:   __emutls_t.k:148 149;;;;; 64-bit targets150 151; X64:      .data{{$}}152; X64:      .globl __emutls_v.i153; X64-LABEL: __emutls_v.i:154; X64-NEXT: .quad 4155; X64-NEXT: .quad 4156; X64-NEXT: .quad 0157; X64-NEXT: .quad __emutls_t.i158 159; X64:      .section .rodata,160; X64-LABEL: __emutls_t.i:161; X64-NEXT: .long 15162 163; X64:      .data{{$}}164; X64-NOT:  .globl165; X64-LABEL: __emutls_v.j:166; X64-NEXT: .quad 4167; X64-NEXT: .quad 4168; X64-NEXT: .quad 0169; X64-NEXT: .quad __emutls_t.j170 171; X64:      .section .rodata,172; X64-LABEL: __emutls_t.j:173; X64-NEXT: .long 42174 175; X64:      .data{{$}}176; X64-NOT:  .globl177; X64-LABEL: __emutls_v.k:178; X64-NEXT: .quad 4179; X64-NEXT: .quad 8180; X64-NEXT: .quad 0181; X64-NEXT: .quad 0182 183; X64-NOT:   __emutls_t.k:184