1;; Generate ELF attributes from llc.
2
3; RUN: llc -mtriple=riscv32 -mattr=+m %s -o - | FileCheck --check-prefix=RV32M %s
4; RUN: llc -mtriple=riscv32 -mattr=+a %s -o - | FileCheck --check-prefix=RV32A %s
5; RUN: llc -mtriple=riscv32 -mattr=+f %s -o - | FileCheck --check-prefix=RV32F %s
6; RUN: llc -mtriple=riscv32 -mattr=+d %s -o - | FileCheck --check-prefix=RV32D %s
7; RUN: llc -mtriple=riscv32 -mattr=+c %s -o - | FileCheck --check-prefix=RV32C %s
8; RUN: llc -mtriple=riscv32 -mattr=+zfhmin %s -o - | FileCheck --check-prefix=RV32ZFHMIN %s
9; RUN: llc -mtriple=riscv32 -mattr=+zfh %s -o - | FileCheck --check-prefix=RV32ZFH %s
10; RUN: llc -mtriple=riscv32 -mattr=+zba %s -o - | FileCheck --check-prefix=RV32ZBA %s
11; RUN: llc -mtriple=riscv32 -mattr=+zbb %s -o - | FileCheck --check-prefix=RV32ZBB %s
12; RUN: llc -mtriple=riscv32 -mattr=+zbc %s -o - | FileCheck --check-prefix=RV32ZBC %s
13; RUN: llc -mtriple=riscv32 -mattr=+experimental-zbe %s -o - | FileCheck --check-prefix=RV32ZBE %s
14; RUN: llc -mtriple=riscv32 -mattr=+experimental-zbf %s -o - | FileCheck --check-prefix=RV32ZBF %s
15; RUN: llc -mtriple=riscv32 -mattr=+experimental-zbm %s -o - | FileCheck --check-prefix=RV32ZBM %s
16; RUN: llc -mtriple=riscv32 -mattr=+experimental-zbp %s -o - | FileCheck --check-prefix=RV32ZBP %s
17; RUN: llc -mtriple=riscv32 -mattr=+experimental-zbr %s -o - | FileCheck --check-prefix=RV32ZBR %s
18; RUN: llc -mtriple=riscv32 -mattr=+zbs %s -o - | FileCheck --check-prefix=RV32ZBS %s
19; RUN: llc -mtriple=riscv32 -mattr=+experimental-zbt %s -o - | FileCheck --check-prefix=RV32ZBT %s
20; RUN: llc -mtriple=riscv32 -mattr=+experimental-v %s -o - | FileCheck --check-prefix=RV32V %s
21; RUN: llc -mtriple=riscv32 -mattr=+zbb,+zfh,+experimental-v,+f,+experimental-zvlsseg %s -o - | FileCheck --check-prefix=RV32COMBINED %s
22; RUN: llc -mtriple=riscv64 -mattr=+m %s -o - | FileCheck --check-prefix=RV64M %s
23; RUN: llc -mtriple=riscv64 -mattr=+a %s -o - | FileCheck --check-prefix=RV64A %s
24; RUN: llc -mtriple=riscv64 -mattr=+f %s -o - | FileCheck --check-prefix=RV64F %s
25; RUN: llc -mtriple=riscv64 -mattr=+d %s -o - | FileCheck --check-prefix=RV64D %s
26; RUN: llc -mtriple=riscv64 -mattr=+c %s -o - | FileCheck --check-prefix=RV64C %s
27; RUN: llc -mtriple=riscv64 -mattr=+zfhmin %s -o - | FileCheck --check-prefix=RV64ZFHMIN %s
28; RUN: llc -mtriple=riscv64 -mattr=+zfh %s -o - | FileCheck --check-prefix=RV64ZFH %s
29; RUN: llc -mtriple=riscv64 -mattr=+zba %s -o - | FileCheck --check-prefix=RV64ZBA %s
30; RUN: llc -mtriple=riscv64 -mattr=+zbb %s -o - | FileCheck --check-prefix=RV64ZBB %s
31; RUN: llc -mtriple=riscv64 -mattr=+zbc %s -o - | FileCheck --check-prefix=RV64ZBC %s
32; RUN: llc -mtriple=riscv64 -mattr=+experimental-zbe %s -o - | FileCheck --check-prefix=RV64ZBE %s
33; RUN: llc -mtriple=riscv64 -mattr=+experimental-zbf %s -o - | FileCheck --check-prefix=RV64ZBF %s
34; RUN: llc -mtriple=riscv64 -mattr=+experimental-zbm %s -o - | FileCheck --check-prefix=RV64ZBM %s
35; RUN: llc -mtriple=riscv64 -mattr=+experimental-zbp %s -o - | FileCheck --check-prefix=RV64ZBP %s
36; RUN: llc -mtriple=riscv64 -mattr=+experimental-zbr %s -o - | FileCheck --check-prefix=RV64ZBR %s
37; RUN: llc -mtriple=riscv64 -mattr=+zbs %s -o - | FileCheck --check-prefix=RV64ZBS %s
38; RUN: llc -mtriple=riscv64 -mattr=+experimental-zbt %s -o - | FileCheck --check-prefix=RV64ZBT %s
39; RUN: llc -mtriple=riscv64 -mattr=+experimental-v %s -o - | FileCheck --check-prefix=RV64V %s
40; RUN: llc -mtriple=riscv64 -mattr=+zbb,+zfh,+experimental-v,+f,+experimental-zvlsseg %s -o - | FileCheck --check-prefix=RV64COMBINED %s
41
42
43; RV32M: .attribute 5, "rv32i2p0_m2p0"
44; RV32A: .attribute 5, "rv32i2p0_a2p0"
45; RV32F: .attribute 5, "rv32i2p0_f2p0"
46; RV32D: .attribute 5, "rv32i2p0_f2p0_d2p0"
47; RV32C: .attribute 5, "rv32i2p0_c2p0"
48; RV32ZFHMIN: .attribute 5, "rv32i2p0_f2p0_zfhmin1p0"
49; RV32ZFH: .attribute 5, "rv32i2p0_f2p0_zfh1p0_zfhmin1p0"
50; RV32ZBA: .attribute 5, "rv32i2p0_zba1p0"
51; RV32ZBB: .attribute 5, "rv32i2p0_zbb1p0"
52; RV32ZBC: .attribute 5, "rv32i2p0_zbc1p0"
53; RV32ZBE: .attribute 5, "rv32i2p0_zbe0p93"
54; RV32ZBF: .attribute 5, "rv32i2p0_zbf0p93"
55; RV32ZBM: .attribute 5, "rv32i2p0_zbm0p93"
56; RV32ZBP: .attribute 5, "rv32i2p0_zbp0p93"
57; RV32ZBR: .attribute 5, "rv32i2p0_zbr0p93"
58; RV32ZBS: .attribute 5, "rv32i2p0_zbs1p0"
59; RV32ZBT: .attribute 5, "rv32i2p0_zbt0p93"
60; RV32V: .attribute 5, "rv32i2p0_v0p10_zvl128b0p10_zvl32b0p10_zvl64b0p10_zvlsseg0p10"
61; RV32COMBINED: .attribute 5, "rv32i2p0_f2p0_v0p10_zfh1p0_zfhmin1p0_zbb1p0_zvl128b0p10_zvl32b0p10_zvl64b0p10_zvlsseg0p10"
62
63; RV64M: .attribute 5, "rv64i2p0_m2p0"
64; RV64A: .attribute 5, "rv64i2p0_a2p0"
65; RV64F: .attribute 5, "rv64i2p0_f2p0"
66; RV64D: .attribute 5, "rv64i2p0_f2p0_d2p0"
67; RV64C: .attribute 5, "rv64i2p0_c2p0"
68; RV64ZFHMIN: .attribute 5, "rv64i2p0_f2p0_zfhmin1p0"
69; RV64ZFH: .attribute 5, "rv64i2p0_f2p0_zfh1p0_zfhmin1p0"
70; RV64ZBA: .attribute 5, "rv64i2p0_zba1p0"
71; RV64ZBB: .attribute 5, "rv64i2p0_zbb1p0"
72; RV64ZBC: .attribute 5, "rv64i2p0_zbc1p0"
73; RV64ZBE: .attribute 5, "rv64i2p0_zbe0p93"
74; RV64ZBF: .attribute 5, "rv64i2p0_zbf0p93"
75; RV64ZBM: .attribute 5, "rv64i2p0_zbm0p93"
76; RV64ZBP: .attribute 5, "rv64i2p0_zbp0p93"
77; RV64ZBR: .attribute 5, "rv64i2p0_zbr0p93"
78; RV64ZBS: .attribute 5, "rv64i2p0_zbs1p0"
79; RV64ZBT: .attribute 5, "rv64i2p0_zbt0p93"
80; RV64V: .attribute 5, "rv64i2p0_v0p10_zvl128b0p10_zvl32b0p10_zvl64b0p10_zvlsseg0p10"
81; RV64COMBINED: .attribute 5, "rv64i2p0_f2p0_v0p10_zfh1p0_zfhmin1p0_zbb1p0_zvl128b0p10_zvl32b0p10_zvl64b0p10_zvlsseg0p10"
82
83define i32 @addi(i32 %a) {
84  %1 = add i32 %a, 1
85  ret i32 %1
86}
87