xref: /llvm-project/llvm/test/CodeGen/RISCV/align.ll (revision 08165c444e11defd42d417fa88a3dede83b230e5)
1; RUN: llc -mtriple=riscv32 -verify-machineinstrs < %s \
2; RUN:   | FileCheck %s -check-prefix=RV32I
3; RUN: llc -mtriple=riscv32 -mattr=+c -verify-machineinstrs < %s \
4; RUN:   | FileCheck %s -check-prefix=RV32C
5; RUN: llc -filetype=obj -mtriple=riscv32 < %s -o %t
6; RUN: llvm-readelf -S %t | FileCheck %s --check-prefixes=SEC,SEC-I
7; RUN: llc -filetype=obj -mtriple=riscv32 -mattr=+c < %s -o %t
8; RUN: llvm-readelf -S %t | FileCheck %s --check-prefixes=SEC,SEC-C
9
10; SEC:   Name   Type     Address  Off      Size     ES Flg Lk Inf Al
11; SEC-I: .text  PROGBITS 00000000 [[#%x,]] [[#%x,]] 00  AX  0   0  4
12; SEC-C: .text  PROGBITS 00000000 [[#%x,]] [[#%x,]] 00  AX  0   0  2
13
14define void @foo() {
15;RV32I: .p2align 2
16;RV32I: foo:
17;RV32C: .p2align 1
18;RV32C: foo:
19entry:
20  ret void
21}
22