mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-21 03:53:04 +02:00
bf6282b7aa
Switch to MC for instruction printing. This encompasses several changes which are all interconnected: - Use the MC framework for printing almost all instructions. - AsmStrings are now live. - This introduces an indirection between LLVM vregs and WebAssembly registers, and a new pass, WebAssemblyRegNumbering, for computing a basic the mapping. This addresses some basic issues with argument registers and unused registers. - The way ARGUMENT instructions are handled no longer generates redundant get_local+set_local for every argument. This also changes the assembly syntax somewhat; most notably, MC's printing does not use sigils on label names, so those are no longer present, and push/pop now have a sigil to keep them unambiguous. The usage of set_local/get_local/$push/$pop will continue to evolve significantly. This patch is just one step of a larger change. llvm-svn: 252910
35 lines
699 B
LLVM
35 lines
699 B
LLVM
; RUN: llc < %s -asm-verbose=false | FileCheck %s
|
|
; RUN: llc < %s -asm-verbose=false -fast-isel | FileCheck %s
|
|
|
|
; Test that LLVM unreachable instruction and trap intrinsic are lowered to
|
|
; wasm unreachable
|
|
|
|
target datalayout = "e-p:32:32-i64:64-n32:64-S128"
|
|
target triple = "wasm32-unknown-unknown"
|
|
|
|
declare void @llvm.trap()
|
|
declare void @llvm.debugtrap()
|
|
declare void @abort()
|
|
|
|
; CHECK-LABEL: f1:
|
|
; CHECK: call abort
|
|
; CHECK: unreachable
|
|
define i32 @f1() {
|
|
call void @abort()
|
|
unreachable
|
|
}
|
|
|
|
; CHECK-LABEL: f2:
|
|
; CHECK: unreachable
|
|
define void @f2() {
|
|
call void @llvm.trap()
|
|
ret void
|
|
}
|
|
|
|
; CHECK-LABEL: f3:
|
|
; CHECK: unreachable
|
|
define void @f3() {
|
|
call void @llvm.debugtrap()
|
|
ret void
|
|
}
|