[llvm] r345334 - Address comments
Heejin Ahn via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 25 16:35:14 PDT 2018
Author: aheejin
Date: Thu Oct 25 16:35:14 2018
New Revision: 345334
URL: http://llvm.org/viewvc/llvm-project?rev=345334&view=rev
Log:
Address comments
- Add llvm-mc test case (and delete the old one)
- Change report_fatal_error to assertions
Added:
llvm/trunk/test/MC/WebAssembly/block-mismatch.s
Removed:
llvm/trunk/test/CodeGen/WebAssembly/block-mismatch.mir
Modified:
llvm/trunk/lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.cpp
Modified: llvm/trunk/lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.cpp?rev=345334&r1=345333&r2=345334&view=diff
==============================================================================
--- llvm/trunk/lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.cpp (original)
+++ llvm/trunk/lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.cpp Thu Oct 25 16:35:14 2018
@@ -85,14 +85,12 @@ void WebAssemblyInstPrinter::printInst(c
break;
case WebAssembly::END_LOOP:
case WebAssembly::END_LOOP_S:
- if (ControlFlowStack.empty())
- report_fatal_error("End marker mismatch!");
+ assert(!ControlFlowStack.empty() && "End marker mismatch!");
ControlFlowStack.pop_back();
break;
case WebAssembly::END_BLOCK:
case WebAssembly::END_BLOCK_S:
- if (ControlFlowStack.empty())
- report_fatal_error("END marker mismatch!");
+ assert(!ControlFlowStack.empty() && "End marker mismatch!");
printAnnotation(
OS, "label" + utostr(ControlFlowStack.pop_back_val().first) + ':');
break;
Removed: llvm/trunk/test/CodeGen/WebAssembly/block-mismatch.mir
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/WebAssembly/block-mismatch.mir?rev=345333&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/WebAssembly/block-mismatch.mir (original)
+++ llvm/trunk/test/CodeGen/WebAssembly/block-mismatch.mir (removed)
@@ -1,18 +0,0 @@
-# RUN: not llc -mtriple=wasm32-unknown-unknown -start-after xray-instrumentation %s -o /dev/null 2>&1 | FileCheck %s
-
-# This tests if there are block/loop marker mismatches, the program crashes.
-
----
-name: block_mismatch
-liveins:
- - { reg: '$arguments', reg: '$value_stack' }
-tracksRegLiveness: true
-body: |
- bb.0:
- liveins: $arguments, $value_stack
- BLOCK 64, implicit-def $value_stack, implicit $value_stack
- END_BLOCK implicit-def $value_stack, implicit $value_stack
- ; CHECK: LLVM ERROR: END marker mismatch!
- END_BLOCK implicit-def $value_stack, implicit $value_stack
- RETURN_VOID implicit-def dead $arguments
-...
Added: llvm/trunk/test/MC/WebAssembly/block-mismatch.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/WebAssembly/block-mismatch.s?rev=345334&view=auto
==============================================================================
--- llvm/trunk/test/MC/WebAssembly/block-mismatch.s (added)
+++ llvm/trunk/test/MC/WebAssembly/block-mismatch.s Thu Oct 25 16:35:14 2018
@@ -0,0 +1,13 @@
+# RUN: not llvm-mc -triple=wasm32-unknown-unknown %s -o - 2>&1 | FileCheck %s
+
+# This tests if there are block/loop marker mismatches, the program crashes.
+ .text
+ .type test0, at function
+test0:
+ block
+ end_block
+ # CHECK: End marker mismatch!
+ end_block
+ end_function
+.Lfunc_end1:
+ .size test1, .Lfunc_end1-test1
More information about the llvm-commits
mailing list