1 ## Test llvm-readobj & llvm-readelf can decode RISC-V attributes correctly.
3 # RUN: llvm-mc -triple riscv32 -filetype obj -o %t.rv32.o %s
4 # RUN: llvm-mc -triple riscv64 -filetype obj -o %t.rv64.o %s
5 # RUN: llvm-readobj --arch-specific %t.rv32.o \
6 # RUN: | FileCheck %s --check-prefix=CHECK-OBJ
7 # RUN: llvm-readelf -A %t.rv32.o \
8 # RUN: | FileCheck %s --check-prefix=CHECK-OBJ
9 # RUN: llvm-readobj --arch-specific %t.rv64.o \
10 # RUN: | FileCheck %s --check-prefix=CHECK-OBJ
11 # RUN: llvm-readelf -A %t.rv64.o \
12 # RUN: | FileCheck %s --check-prefix=CHECK-OBJ
14 .attribute Tag_stack_align, 16
16 # CHECK-OBJ-NEXT: Value: 16
17 # CHECK-OBJ-NEXT: TagName: stack_align
18 # CHECK-OBJ-NEXT: Description: Stack alignment is 16-bytes
20 .attribute Tag_arch, "rv32i2p1_m2p0_a2p1_c2p0"
22 # CHECK-OBJ-NEXT: TagName: arch
23 # CHECK-OBJ-NEXT: Value: rv32i2p1_m2p0_a2p1_c2p0
25 .attribute Tag_unaligned_access, 0
27 # CHECK-OBJ-NEXT: Value: 0
28 # CHECK-OBJ-NEXT: TagName: unaligned_access
29 # CHECK-OBJ-NEXT: Description: No unaligned access
31 .attribute Tag_priv_spec, 2
33 # CHECK-OBJ-NEXT: TagName: priv_spec
34 # CHECK-OBJ-NEXT: Value: 2
36 .attribute Tag_priv_spec_minor, 0
38 # CHECK-OBJ-NEXT: TagName: priv_spec_minor
39 # CHECK-OBJ-NEXT: Value: 0
41 .attribute Tag_priv_spec_revision, 0
43 # CHECK-OBJ-NEXT: TagName: priv_spec_revision
44 # CHECK-OBJ-NEXT: Value: 0