diff --git a/llvm/test/CodeGen/RISCV/unnecessary-code-align.ll b/llvm/test/CodeGen/RISCV/unnecessary-code-align.ll new file mode 100644 --- /dev/null +++ b/llvm/test/CodeGen/RISCV/unnecessary-code-align.ll @@ -0,0 +1,14 @@ +; RUN: llc -mtriple=riscv64 -filetype=obj -mattr=+c,+relax %s -o - \ +; RUN: | llvm-readobj -r - | FileCheck %s + +; CHECK: Relocations [ +; CHECK-NEXT: Section (3) .rela.text { +; CHECK-NEXT: 0x0 R_RISCV_ALIGN - 0x2 +; CHECK-NEXT: } +; CHECK-NEXT: ] +define i32 @test() #0 { +entry: + ret i32 1 +} + +attributes #0 = { nounwind }