summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/WebAssembly/exception.ll
diff options
context:
space:
mode:
authorHeejin Ahn <aheejin@gmail.com>2018-11-02 18:38:52 +0000
committerHeejin Ahn <aheejin@gmail.com>2018-11-02 18:38:52 +0000
commit5b023e07eafe1c358b02b2ae0bf88bcaadceaf60 (patch)
treed4598fc8032cb445e2107604aeb3d1a3c5f42e1a /llvm/test/CodeGen/WebAssembly/exception.ll
parentb8cfcc71469d40a98f4cc79fcdc46cd67bea45f7 (diff)
downloadbcm5719-llvm-5b023e07eafe1c358b02b2ae0bf88bcaadceaf60.tar.gz
bcm5719-llvm-5b023e07eafe1c358b02b2ae0bf88bcaadceaf60.zip
[WebAssembly] Fix bugs in rethrow depth counting and InstPrinter
Summary: EH stack depth is incremented at `try` and decremented at `catch`. When there are more than two catch instructions for a try instruction, we shouldn't count non-first catches when calculating EH stack depths. This patch fixes two bugs: - CFGStackify: Exclude `catch_all` in the terminate catch pad when calculating EH pad stack, because when we have multiple catches for a try we should count only the first catch instruction when calculating EH pad stack. - InstPrinter: The initial intention was also to exclude non-first catches, but it didn't account nested try-catches, so it failed on this case: ``` try try catch end catch <-- (1) end ``` In the example, when we are at the catch (1), the last seen EH instruction is not `try` but `end_try`, violating the wrong assumption. We don't need these after we switch to the second proposal because there is gonna be only one `catch` instruction. But anyway before then these bugfixes are necessary for keep trunk in working state. Reviewers: dschuff Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D53819 llvm-svn: 346029
Diffstat (limited to 'llvm/test/CodeGen/WebAssembly/exception.ll')
-rw-r--r--llvm/test/CodeGen/WebAssembly/exception.ll1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/WebAssembly/exception.ll b/llvm/test/CodeGen/WebAssembly/exception.ll
index 1714ad6dc40..bd7935c3684 100644
--- a/llvm/test/CodeGen/WebAssembly/exception.ll
+++ b/llvm/test/CodeGen/WebAssembly/exception.ll
@@ -1,5 +1,6 @@
; RUN: not llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -wasm-keep-registers -exception-model=wasm
; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -wasm-keep-registers -exception-model=wasm -mattr=+exception-handling | FileCheck -allow-deprecated-dag-overlap %s
+; RUN: llc < %s -disable-wasm-fallthrough-return-opt -wasm-keep-registers -exception-model=wasm -mattr=+exception-handling
target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
target triple = "wasm32-unknown-unknown"
OpenPOWER on IntegriCloud