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
25 # CHECK-NEXT: c.addi a0, 0x1
29 # CHECK-NEXT: addi zero, zero, 0x0
30 # CHECK-NEXT: addi zero, zero, 0x0
31 # CHECK-NEXT: addi zero, zero, 0x0
34 # CHECK-NEXT: 10010: c.addi a0, 0x2
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
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
54 # CHECK-NEXT: addi a0, a1, 0x1
55 # CHECK-NEXT: c.addi a0, 0x1
57 # CHECK-NEXT: c.addi a0, 0x2
81 .size _start, . - _start