Files
clang-p2996/llvm/test/CodeGen/RISCV/option-rvc.ll
Alex Bradbury bca0c3cdb6 [RISCV] Support .option rvc and norvc assembler directives
These directives allow the 'C' (compressed) extension to be enabled/disabled 
within a single file.

Differential Revision: https://reviews.llvm.org/D45864
Patch by Kito Cheng

llvm-svn: 332107
2018-05-11 17:30:28 +00:00

16 lines
487 B
LLVM

; RUN: llc -mtriple=riscv32 -filetype=obj < %s\
; RUN: | llvm-objdump -triple=riscv32 -mattr=+c -d -riscv-no-aliases -\
; RUN: | FileCheck -check-prefix=CHECK %s
; This test demonstrates that .option norvc has no effect on codegen when
; emitting an ELF directly.
define i32 @add(i32 %a, i32 %b) nounwind {
; CHECK-LABEL: add:
; CHECK: add a0, a1, a0
; CHECK-NEXT: jalr zero, ra, 0
tail call void asm sideeffect ".option rvc", ""()
%add = add nsw i32 %b, %a
ret i32 %add
}