[memprof] Remove an unused using directive (#117004)
[llvm-project.git] / lld / test / ELF / riscv-relax-align-rvc.s
blob8980e18ea876b6e950bf7fe3dd7fa4608d985943
1 # REQUIRES: riscv
3 # RUN: rm -rf %t && mkdir %t && cd %t
5 # RUN: llvm-mc -filetype=obj -triple=riscv32 -mattr=+c,+relax %s -o 32.o
6 # RUN: ld.lld -Ttext=0x10000 32.o -o 32
7 # RUN: llvm-objdump -td --no-show-raw-insn -M no-aliases 32 | FileCheck %s
8 ## R_RISCV_ALIGN is handled regarldess of --no-relax.
9 # RUN: ld.lld -Ttext=0x10000 --no-relax 32.o -o 32.norelax
10 # RUN: llvm-objdump -td --no-show-raw-insn -M no-aliases 32.norelax | FileCheck %s
12 # RUN: llvm-mc -filetype=obj -triple=riscv64 -mattr=+c,+relax %s -o 64.o
13 # RUN: ld.lld -Ttext=0x10000 64.o -o 64
14 # RUN: llvm-objdump -td --no-show-raw-insn -M no-aliases 64 | FileCheck %s
15 # RUN: ld.lld -Ttext=0x10000 --no-relax 64.o -o 64.norelax
16 # RUN: llvm-objdump -td --no-show-raw-insn -M no-aliases 64.norelax | FileCheck %s
18 # CHECK-DAG: 00010002 l .text {{0*}}1e a
19 # CHECK-DAG: 00010010 l .text {{0*}}22 b
20 # CHECK-DAG: 00010012 l .text {{0*}}1e c
21 # CHECK-DAG: 00010020 l .text {{0*}}16 d
22 # CHECK-DAG: 00010000 g .text {{0*}}36 _start
24 # CHECK: <_start>:
25 # CHECK-NEXT: c.addi a0, 0x1
26 # CHECK-EMPTY:
27 # CHECK-NEXT: <a>:
28 # CHECK-NEXT: c.nop
29 # CHECK-NEXT: addi zero, zero, 0x0
30 # CHECK-NEXT: addi zero, zero, 0x0
31 # CHECK-NEXT: addi zero, zero, 0x0
32 # CHECK-EMPTY:
33 # CHECK-NEXT: <b>:
34 # CHECK-NEXT: 10010: c.addi a0, 0x2
35 # CHECK-EMPTY:
36 # CHECK-NEXT: <c>:
37 # CHECK-NEXT: c.addi a0, 0x3
38 # CHECK-NEXT: addi zero, zero, 0x0
39 # CHECK-NEXT: addi zero, zero, 0x0
40 # CHECK-NEXT: addi zero, zero, 0x0
41 # CHECK-EMPTY:
42 # CHECK-NEXT: <d>:
43 # CHECK-NEXT: 10020: c.addi a0, 0x4
44 # CHECK-NEXT: c.addi a0, 0x5
45 # CHECK-NEXT: addi zero, zero, 0x0
46 # CHECK-NEXT: addi zero, zero, 0x0
47 # CHECK-NEXT: addi zero, zero, 0x0
48 # CHECK-NEXT: 10030: c.addi a0, 0x6
49 # CHECK-NEXT: c.addi a0, 0x7
50 # CHECK-NEXT: c.addi a0, 0x8
51 # CHECK-EMPTY:
53 # CHECK: <.text2>:
54 # CHECK-NEXT: addi a0, a1, 0x1
55 # CHECK-NEXT: c.addi a0, 0x1
56 # CHECK-NEXT: c.nop
57 # CHECK-NEXT: c.addi a0, 0x2
59 .global _start
60 _start:
61 c.addi a0, 0x1
63 .balign 16
65 c.addi a0, 0x2
67 c.addi a0, 0x3
68 .balign 32
69 .size a, . - a
71 c.addi a0, 0x4
72 c.addi a0, 0x5
73 .balign 16
74 .size c, . - c
75 c.addi a0, 0x6
76 .size b, . - b
77 c.addi a0, 0x7
78 .balign 4
79 c.addi a0, 0x8
80 .size d, . - d
81 .size _start, . - _start
83 .section .text2,"ax"
84 .balign 16
85 addi a0, a1, 0x1
86 c.addi a0, 0x1
87 .balign 8
88 c.addi a0, 0x2