1 # RUN: llc --mtriple=loongarch64 -mattr=+d --filetype=obj %s -o - | \
2 # RUN: llvm-objdump -d - | FileCheck %s
6 ## Check that bl can get fixupkind correctly, whether BL contains
7 ## target-flags(loongarch-call) or not.
10 target datalayout = "e-m:e-p:64:64-i64:64-i128:128-n64-S128"
11 target triple = "loongarch64"
13 define dso_local void @test_bl_fixupkind_with_flag() {
14 ; CHECK-LABEL: test_bl_fixupkind_with_flag
15 ; CHECK: addi.d $sp, $sp, -16
16 ; CHECK-NEXT: st.d $ra, $sp, 8
17 ; CHECK-NEXT: bl 0 <test_bl_fixupkind_with_flag+0x8>
18 ; CHECK-NEXT: ld.d $ra, $sp, 8
19 ; CHECK-NEXT: addi.d $sp, $sp, 16
26 define dso_local void @test_bl_fixupkind_without_flag() {
27 ; CHECK-LABEL: test_bl_fixupkind_without_flag
28 ; CHECK: addi.d $sp, $sp, -16
29 ; CHECK-NEXT: st.d $ra, $sp, 8
30 ; CHECK-NEXT: bl 0 <test_bl_fixupkind_without_flag+0x8>
31 ; CHECK-NEXT: ld.d $ra, $sp, 8
32 ; CHECK-NEXT: addi.d $sp, $sp, 16
39 declare dso_local void @foo(...)
42 name: test_bl_fixupkind_with_flag
43 tracksRegLiveness: true
46 ADJCALLSTACKDOWN 0, 0, implicit-def dead $r3, implicit $r3
47 BL target-flags(loongarch-call) @foo, csr_ilp32d_lp64d, implicit-def $r1, implicit-def dead $r1, implicit-def $r3
48 ADJCALLSTACKUP 0, 0, implicit-def dead $r3, implicit $r3
53 name: test_bl_fixupkind_without_flag
54 tracksRegLiveness: true
57 ADJCALLSTACKDOWN 0, 0, implicit-def dead $r3, implicit $r3
58 BL @foo, csr_ilp32d_lp64d, implicit-def $r1, implicit-def dead $r1, implicit-def $r3
59 ADJCALLSTACKUP 0, 0, implicit-def dead $r3, implicit $r3