blob: b36b4430f157ae5ac58844265f29a7e211bf354e [file] [log] [blame]
Kai Wang581ba352020-02-04 22:20:10 +08001;; 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=riscv64 -mattr=+m %s -o - | FileCheck --check-prefix=RV64M %s
9; RUN: llc -mtriple=riscv64 -mattr=+a %s -o - | FileCheck --check-prefix=RV64A %s
10; RUN: llc -mtriple=riscv64 -mattr=+f %s -o - | FileCheck --check-prefix=RV64F %s
11; RUN: llc -mtriple=riscv64 -mattr=+d %s -o - | FileCheck --check-prefix=RV64D %s
12; RUN: llc -mtriple=riscv64 -mattr=+c %s -o - | FileCheck --check-prefix=RV64C %s
13
14; RV32M: .attribute 5, "rv32i2p0_m2p0"
15; RV32A: .attribute 5, "rv32i2p0_a2p0"
16; RV32F: .attribute 5, "rv32i2p0_f2p0"
17; RV32D: .attribute 5, "rv32i2p0_f2p0_d2p0"
18; RV32C: .attribute 5, "rv32i2p0_c2p0"
19; RV64M: .attribute 5, "rv64i2p0_m2p0"
20; RV64A: .attribute 5, "rv64i2p0_a2p0"
21; RV64F: .attribute 5, "rv64i2p0_f2p0"
22; RV64D: .attribute 5, "rv64i2p0_f2p0_d2p0"
23; RV64C: .attribute 5, "rv64i2p0_c2p0"
24
25define i32 @addi(i32 %a) {
26 %1 = add i32 %a, 1
27 ret i32 %1
28}