Home | History | Annotate | Download | only in WebAssembly
      1 ; RUN: llc < %s -asm-verbose=false -verify-machineinstrs | FileCheck %s
      2 ; RUN: llc < %s -asm-verbose=false -fast-isel -verify-machineinstrs | FileCheck %s
      3 
      4 ; Test that LLVM unreachable instruction and trap intrinsic are lowered to
      5 ; wasm unreachable
      6 
      7 target datalayout = "e-p:32:32-i64:64-n32:64-S128"
      8 target triple = "wasm32-unknown-unknown"
      9 
     10 declare void @llvm.trap()
     11 declare void @llvm.debugtrap()
     12 declare void @abort()
     13 
     14 ; CHECK-LABEL: f1:
     15 ; CHECK: call abort
     16 ; CHECK: unreachable
     17 define i32 @f1() {
     18   call void @abort()
     19   unreachable
     20 }
     21 
     22 ; CHECK-LABEL: f2:
     23 ; CHECK: unreachable
     24 define void @f2() {
     25   call void @llvm.trap()
     26   ret void
     27 }
     28 
     29 ; CHECK-LABEL: f3:
     30 ; CHECK: unreachable
     31 define void @f3() {
     32   call void @llvm.debugtrap()
     33   ret void
     34 }
     35