1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-02-01 05:01:59 +01:00
llvm-mirror/test/CodeGen/RISCV/option-norvc.ll
Alex Bradbury ac7024c937 [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
489 B
LLVM

; RUN: llc -mtriple=riscv32 -mattr=+c -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: c.add a0, a1
; CHECK-NEXT: c.jr ra
tail call void asm sideeffect ".option norvc", ""()
%add = add nsw i32 %b, %a
ret i32 %add
}