63 lines · plain
1# RUN: llc --mtriple=loongarch64 -mattr=+d --filetype=obj %s -o - | \2# RUN: llvm-objdump -d - | FileCheck %s3 4# REQUIRES: asserts5 6## Check that bl can get fixupkind correctly, whether BL contains7## target-flags(loongarch-call) or not.8 9--- |10 target datalayout = "e-m:e-p:64:64-i64:64-i128:128-n64-S128"11 target triple = "loongarch64"12 13 define dso_local void @test_bl_fixupkind_with_flag() {14 ; CHECK-LABEL: test_bl_fixupkind_with_flag15 ; CHECK: addi.d $sp, $sp, -1616 ; CHECK-NEXT: st.d $ra, $sp, 817 ; CHECK-NEXT: bl 0 <test_bl_fixupkind_with_flag+0x8>18 ; CHECK-NEXT: ld.d $ra, $sp, 819 ; CHECK-NEXT: addi.d $sp, $sp, 1620 ; CHECK-NEXT: ret21 entry:22 call void @foo()23 ret void24 }25 26 define dso_local void @test_bl_fixupkind_without_flag() {27 ; CHECK-LABEL: test_bl_fixupkind_without_flag28 ; CHECK: addi.d $sp, $sp, -1629 ; CHECK-NEXT: st.d $ra, $sp, 830 ; CHECK-NEXT: bl 0 <test_bl_fixupkind_without_flag+0x8>31 ; CHECK-NEXT: ld.d $ra, $sp, 832 ; CHECK-NEXT: addi.d $sp, $sp, 1633 ; CHECK-NEXT: ret34 entry:35 call void @foo()36 ret void37 }38 39 declare dso_local void @foo(...)40...41---42name: test_bl_fixupkind_with_flag43tracksRegLiveness: true44body: |45 bb.0.entry:46 ADJCALLSTACKDOWN 0, 0, implicit-def dead $r3, implicit $r347 BL target-flags(loongarch-call) @foo, csr_ilp32d_lp64d, implicit-def $r1, implicit-def dead $r1, implicit-def $r348 ADJCALLSTACKUP 0, 0, implicit-def dead $r3, implicit $r349 PseudoRET50 51...52---53name: test_bl_fixupkind_without_flag54tracksRegLiveness: true55body: |56 bb.0.entry:57 ADJCALLSTACKDOWN 0, 0, implicit-def dead $r3, implicit $r358 BL @foo, csr_ilp32d_lp64d, implicit-def $r1, implicit-def dead $r1, implicit-def $r359 ADJCALLSTACKUP 0, 0, implicit-def dead $r3, implicit $r360 PseudoRET61 62...63