xref: /llvm-project/llvm/test/CodeGen/LoongArch/blockaddress-symbol.ll (revision 9d4f7f44b64d87d1068859906f43b7ce03a7388b)
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc --mtriple=loongarch32 -mattr=+d < %s | FileCheck %s
3; RUN: llc --mtriple=loongarch64 -mattr=+d < %s | FileCheck %s
4; RUN: llc --mtriple=loongarch32 -mattr=+d --no-integrated-as < %s | FileCheck %s
5; RUN: llc --mtriple=loongarch64 -mattr=+d --no-integrated-as < %s | FileCheck %s
6
7;; This regression test is for ensuring the AsmParser does not use the
8;; getOrCreateSymbol interface to create blockaddress symbols.
9;; Otherwise incorrect symbols will be created:
10;; `.Ltmp0` -> `.Ltmp00`.
11
12define void @operand_block_address() nounwind {
13; CHECK-LABEL: operand_block_address:
14; CHECK:       # %bb.0:
15; CHECK-NEXT:    #APP
16; CHECK-NEXT:    b .Ltmp0
17; CHECK-NEXT:    #NO_APP
18; CHECK-NEXT:  .Ltmp0: # Block address taken
19; CHECK-NEXT:  # %bb.1: # %bb
20; CHECK-NEXT:    ret
21  call void asm sideeffect "b $0", "i"(ptr blockaddress(@operand_block_address, %bb))
22  br label %bb
23bb:
24  ret void
25}
26