2018-05-12 01:30:28 +08:00
|
|
|
; RUN: llc -mtriple=riscv32 -mattr=+c -filetype=obj < %s\
|
2020-03-16 07:17:52 +08:00
|
|
|
; RUN: | llvm-objdump --triple=riscv32 --mattr=+c -d -M no-aliases -\
|
2018-05-12 01:30:28 +08:00
|
|
|
; 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 {
|
2020-03-06 06:18:38 +08:00
|
|
|
; CHECK-LABEL: <add>:
|
2018-05-12 01:30:28 +08:00
|
|
|
; 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
|
|
|
|
}
|