[ELF] Reorder SectionBase/InputSectionBase members
[llvm-project.git] / lld / test / ELF / lto / riscv-attributes.ll
blobb6d4ec820f951cf66c2c4e96384b2839e3aba3b8
1 ; REQUIRES: riscv
3 ; RUN: rm -rf %t && split-file %s %t && cd %t
4 ; RUN: llvm-mc -filetype=obj -triple=riscv32 1.s -o 1.o
5 ; RUN: llvm-mc -filetype=obj -triple=riscv32 2.s -o 2.o
6 ; RUN: llvm-as a.ll -o a.bc
7 ; RUN: ld.lld 1.o 2.o a.bc -o out
8 ; RUN: llvm-readelf --arch-specific out | FileCheck %s
10 ; CHECK:      BuildAttributes {
11 ; CHECK-NEXT:   FormatVersion: 0x41
12 ; CHECK-NEXT:   Section 1 {
13 ; CHECK-NEXT:     SectionLength: 98
14 ; CHECK-NEXT:     Vendor: riscv
15 ; CHECK-NEXT:     Tag: Tag_File (0x1)
16 ; CHECK-NEXT:     Size: 88
17 ; CHECK-NEXT:     FileAttributes {
18 ; CHECK-NEXT:       Attribute {
19 ; CHECK-NEXT:         Tag: 4
20 ; CHECK-NEXT:         Value: 16
21 ; CHECK-NEXT:         TagName: stack_align
22 ; CHECK-NEXT:         Description: Stack alignment is 16-bytes
23 ; CHECK-NEXT:       }
24 ; CHECK-NEXT:       Attribute {
25 ; CHECK-NEXT:         Tag: 6
26 ; CHECK-NEXT:         Value: 1
27 ; CHECK-NEXT:         TagName: unaligned_access
28 ; CHECK-NEXT:         Description: Unaligned access
29 ; CHECK-NEXT:       }
30 ; CHECK-NEXT:       Attribute {
31 ; CHECK-NEXT:         Tag: 5
32 ; CHECK-NEXT:         TagName: arch
33 ; CHECK-NEXT:         Value: rv32i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zmmul1p0_zaamo1p0_zalrsc1p0_zbb1p0{{$}}
34 ; CHECK-NEXT:       }
35 ; CHECK-NEXT:     }
36 ; CHECK-NEXT:   }
37 ; CHECK-NEXT: }
39 ;--- 1.s
40 .attribute 4, 16
41 .attribute 5, "rv32i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zmmul1p0"
42 ;--- 2.s
43 .attribute 4, 16
44 .attribute 5, "rv32i2p1_m2p0_f2p2_d2p2_zbb1p0_zmmul1p0"
45 .attribute 6, 1
47 ;--- a.ll
48 target datalayout = "e-m:e-p:32:32-i64:64-n32-S128"
49 target triple = "riscv32"
51 define void @_start() {
52   ret void