brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.2 KiB · 1a032b6 Raw
71 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc -mtriple=riscv32 -relocation-model=static < %s | FileCheck %s --check-prefix=RV323; RUN: llc -mtriple=riscv64 -relocation-model=pic < %s | FileCheck %s --check-prefix=RV644 5@var = external dso_local global i32, align 46@a = external global [2 x [2 x i32]], align 47 8define dso_local void @test() {9; RV32-LABEL: test:10; RV32:       # %bb.0: # %entry11; RV32-NEXT:    #APP12; RV32-NEXT:    # var a+12 test13; RV32-NEXT:    #NO_APP14; RV32-NEXT:    #APP15; RV32-NEXT:    # var a+12 test16; RV32-NEXT:    #NO_APP17; RV32-NEXT:    ret18;19; RV64-LABEL: test:20; RV64:       # %bb.0: # %entry21; RV64-NEXT:    #APP22; RV64-NEXT:    # var a+12 .Ltest$local23; RV64-NEXT:    #NO_APP24; RV64-NEXT:    #APP25; RV64-NEXT:    # var a+12 .Ltest$local26; RV64-NEXT:    #NO_APP27; RV64-NEXT:    ret28entry:29  call void asm sideeffect "// $0 $1 $2", "s,s,s,~{dirflag},~{fpsr},~{flags}"(ptr @var, ptr getelementptr inbounds ([2 x [2 x i32]], ptr @a, i64 0, i64 1, i64 1), ptr @test)30 31  ;; Implement "S" as an alias for "s".32  call void asm sideeffect "// $0 $1 $2", "S,S,S,~{dirflag},~{fpsr},~{flags}"(ptr @var, ptr getelementptr inbounds ([2 x [2 x i32]], ptr @a, i64 0, i64 1, i64 1), ptr @test)33  ret void34}35 36; Function Attrs: nofree nosync nounwind readnone37define dso_local ptr @test_label() {38; RV32-LABEL: test_label:39; RV32:       # %bb.0: # %entry40; RV32-NEXT:  .Ltmp0: # Block address taken41; RV32-NEXT:  # %bb.1: # %L142; RV32-NEXT:    #APP43; RV32-NEXT:    # .Ltmp044; RV32-NEXT:    #NO_APP45; RV32-NEXT:    #APP46; RV32-NEXT:    lui a0, %hi(.Ltmp0)47; RV32-NEXT:    addi a0, a0, %lo(.Ltmp0)48; RV32-NEXT:    #NO_APP49; RV32-NEXT:    ret50;51; RV64-LABEL: test_label:52; RV64:       # %bb.0: # %entry53; RV64-NEXT:  .Ltmp0: # Block address taken54; RV64-NEXT:  # %bb.1: # %L155; RV64-NEXT:    #APP56; RV64-NEXT:    # .Ltmp057; RV64-NEXT:    #NO_APP58; RV64-NEXT:    #APP59; RV64-NEXT:    lui a0, %hi(.Ltmp0)60; RV64-NEXT:    addi a0, a0, %lo(.Ltmp0)61; RV64-NEXT:    #NO_APP62; RV64-NEXT:    ret63entry:64  br label %L165 66L1:67  call void asm sideeffect "// $0", "s,~{dirflag},~{fpsr},~{flags}"(ptr blockaddress(@test_label, %L1))68  %ret = tail call ptr asm "lui $0, %hi($1)\0Aaddi $0, $0, %lo($1)", "=r,S"(ptr blockaddress(@test_label, %L1))69  ret ptr %ret70}71