diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-07-01 13:22:02 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-07-01 13:22:02 +0000 |
commit | 9df3605dea17e84f8183581f6103bd0c79e2a606 (patch) | |
tree | 70a2f36ce9eb9bb213603cd7f2f120af53fc176f /test/CodeGen/WebAssembly/exception.ll | |
parent | 08bbd35a80bf7765fe0d3043f9eb5a2f2786b649 (diff) |
Diffstat (limited to 'test/CodeGen/WebAssembly/exception.ll')
-rw-r--r-- | test/CodeGen/WebAssembly/exception.ll | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/CodeGen/WebAssembly/exception.ll b/test/CodeGen/WebAssembly/exception.ll new file mode 100644 index 0000000000000..eedb5c78b241f --- /dev/null +++ b/test/CodeGen/WebAssembly/exception.ll @@ -0,0 +1,22 @@ +; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -disable-wasm-explicit-locals | FileCheck %s + +target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128" +target triple = "wasm32-unknown-unknown-wasm" + +declare void @llvm.wasm.throw(i32, i8*) +declare void @llvm.wasm.rethrow() + +; CHECK-LABEL: throw: +; CHECK-NEXT: i32.const $push0=, 0 +; CHECK-NEXT: throw 0, $pop0 +define void @throw() { + call void @llvm.wasm.throw(i32 0, i8* null) + ret void +} + +; CHECK-LABEL: rethrow: +; CHECK-NEXT: rethrow 0 +define void @rethrow() { + call void @llvm.wasm.rethrow() + ret void +} |