brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.4 KiB · 4f6e993 Raw
140 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc -mtriple=riscv32 -emulated-tls -relocation-model=pic < %s \3; RUN:     | FileCheck -check-prefix=RV32 %s4; RUN: llc -mtriple=riscv64 -emulated-tls -relocation-model=pic < %s \5; RUN:     | FileCheck -check-prefix=RV64 %s6 7@external_x = external thread_local global i32, align 88@y = thread_local global i8 7, align 29@internal_z = internal thread_local global i64 9, align 1610 11define ptr @get_external_x() nounwind {12; RV32-LABEL: get_external_x:13; RV32:       # %bb.0: # %entry14; RV32-NEXT:    addi sp, sp, -1615; RV32-NEXT:    sw ra, 12(sp) # 4-byte Folded Spill16; RV32-NEXT:  .Lpcrel_hi0:17; RV32-NEXT:    auipc a0, %got_pcrel_hi(__emutls_v.external_x)18; RV32-NEXT:    lw a0, %pcrel_lo(.Lpcrel_hi0)(a0)19; RV32-NEXT:    call __emutls_get_address20; RV32-NEXT:    lw ra, 12(sp) # 4-byte Folded Reload21; RV32-NEXT:    addi sp, sp, 1622; RV32-NEXT:    ret23;24; RV64-LABEL: get_external_x:25; RV64:       # %bb.0: # %entry26; RV64-NEXT:    addi sp, sp, -1627; RV64-NEXT:    sd ra, 8(sp) # 8-byte Folded Spill28; RV64-NEXT:  .Lpcrel_hi0:29; RV64-NEXT:    auipc a0, %got_pcrel_hi(__emutls_v.external_x)30; RV64-NEXT:    ld a0, %pcrel_lo(.Lpcrel_hi0)(a0)31; RV64-NEXT:    call __emutls_get_address32; RV64-NEXT:    ld ra, 8(sp) # 8-byte Folded Reload33; RV64-NEXT:    addi sp, sp, 1634; RV64-NEXT:    ret35entry:36  ret ptr @external_x37}38 39define ptr @get_y() nounwind {40; RV32-LABEL: get_y:41; RV32:       # %bb.0: # %entry42; RV32-NEXT:    addi sp, sp, -1643; RV32-NEXT:    sw ra, 12(sp) # 4-byte Folded Spill44; RV32-NEXT:  .Lpcrel_hi1:45; RV32-NEXT:    auipc a0, %got_pcrel_hi(__emutls_v.y)46; RV32-NEXT:    lw a0, %pcrel_lo(.Lpcrel_hi1)(a0)47; RV32-NEXT:    call __emutls_get_address48; RV32-NEXT:    lw ra, 12(sp) # 4-byte Folded Reload49; RV32-NEXT:    addi sp, sp, 1650; RV32-NEXT:    ret51;52; RV64-LABEL: get_y:53; RV64:       # %bb.0: # %entry54; RV64-NEXT:    addi sp, sp, -1655; RV64-NEXT:    sd ra, 8(sp) # 8-byte Folded Spill56; RV64-NEXT:  .Lpcrel_hi1:57; RV64-NEXT:    auipc a0, %got_pcrel_hi(__emutls_v.y)58; RV64-NEXT:    ld a0, %pcrel_lo(.Lpcrel_hi1)(a0)59; RV64-NEXT:    call __emutls_get_address60; RV64-NEXT:    ld ra, 8(sp) # 8-byte Folded Reload61; RV64-NEXT:    addi sp, sp, 1662; RV64-NEXT:    ret63entry:64  ret ptr @y65}66 67define ptr @get_internal_z() nounwind {68; RV32-LABEL: get_internal_z:69; RV32:       # %bb.0: # %entry70; RV32-NEXT:    addi sp, sp, -1671; RV32-NEXT:    sw ra, 12(sp) # 4-byte Folded Spill72; RV32-NEXT:  .Lpcrel_hi2:73; RV32-NEXT:    auipc a0, %pcrel_hi(__emutls_v.internal_z)74; RV32-NEXT:    addi a0, a0, %pcrel_lo(.Lpcrel_hi2)75; RV32-NEXT:    call __emutls_get_address76; RV32-NEXT:    lw ra, 12(sp) # 4-byte Folded Reload77; RV32-NEXT:    addi sp, sp, 1678; RV32-NEXT:    ret79;80; RV64-LABEL: get_internal_z:81; RV64:       # %bb.0: # %entry82; RV64-NEXT:    addi sp, sp, -1683; RV64-NEXT:    sd ra, 8(sp) # 8-byte Folded Spill84; RV64-NEXT:  .Lpcrel_hi2:85; RV64-NEXT:    auipc a0, %pcrel_hi(__emutls_v.internal_z)86; RV64-NEXT:    addi a0, a0, %pcrel_lo(.Lpcrel_hi2)87; RV64-NEXT:    call __emutls_get_address88; RV64-NEXT:    ld ra, 8(sp) # 8-byte Folded Reload89; RV64-NEXT:    addi sp, sp, 1690; RV64-NEXT:    ret91entry:92  ret ptr @internal_z93}94 95; UTC_ARGS: --disable96 97; RV32:        .data98; RV32:        .globl __emutls_v.y99; RV32:        .p2align 2100; RV32-LABEL:  __emutls_v.y:101; RV32-NEXT:     .word 1102; RV32-NEXT:     .word 2103; RV32-NEXT:     .word 0104; RV32-NEXT:     .word __emutls_t.y105; RV32:        .section .rodata,106; RV32-LABEL:  __emutls_t.y:107; RV32-NEXT:     .byte 7108; RV32:        .data109; RV32:        .p2align 2110; RV32-LABEL:  __emutls_v.internal_z:111; RV32-NEXT:     .word 8112; RV32-NEXT:     .word 16113; RV32-NEXT:     .word 0114; RV32-NEXT:     .word __emutls_t.internal_z115; RV32:        .section .rodata,116; RV32-LABEL:  __emutls_t.internal_z:117; RV32-NEXT:     .quad 9118 119; RV64:        .data120; RV64:        .globl __emutls_v.y121; RV64:        .p2align 3122; RV64-LABEL:  __emutls_v.y:123; RV64-NEXT:     .quad 1124; RV64-NEXT:     .quad 2125; RV64-NEXT:     .quad 0126; RV64-NEXT:     .quad __emutls_t.y127; RV64:        .section .rodata,128; RV64-LABEL:  __emutls_t.y:129; RV64-NEXT:     .byte 7130; RV64:        .data131; RV64:        .p2align 3132; RV64-LABEL:  __emutls_v.internal_z:133; RV64-NEXT:     .quad 8134; RV64-NEXT:     .quad 16135; RV64-NEXT:     .quad 0136; RV64-NEXT:     .quad __emutls_t.internal_z137; RV64:        .section .rodata,138; RV64-LABEL:  __emutls_t.internal_z:139; RV64-NEXT:     .quad 9140