summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorDerek Schuff <dschuff@google.com>2015-11-16 21:12:41 +0000
committerDerek Schuff <dschuff@google.com>2015-11-16 21:12:41 +0000
commit46e331688800d785770f64c41804e6271127dd80 (patch)
treee25a525eb0fc7631c209811630b33dbe16f16516 /llvm/test
parent4ed47784197e3922e0aa41cc89c6fd7d82221566 (diff)
downloadbcm5719-llvm-46e331688800d785770f64c41804e6271127dd80.tar.gz
bcm5719-llvm-46e331688800d785770f64c41804e6271127dd80.zip
[WebAssembly] Fix function return type printing
Summary: Previously return type information for a function was derived from return dag nodes. But this didn't work for dags with != return node. So instead compute it directly from the LLVM function as is done for imports. Differential Revision: http://reviews.llvm.org/D14593 llvm-svn: 253251
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/CodeGen/WebAssembly/func.ll21
1 files changed, 21 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/WebAssembly/func.ll b/llvm/test/CodeGen/WebAssembly/func.ll
index 17d20760e8c..97fd9913641 100644
--- a/llvm/test/CodeGen/WebAssembly/func.ll
+++ b/llvm/test/CodeGen/WebAssembly/func.ll
@@ -45,3 +45,24 @@ define i32 @f2(i32 %p1, float %p2) {
define void @f3(i32 %p1, float %p2) {
ret void
}
+
+; CHECK-LABEL: f4:
+; CHECK-NEXT: .param i32{{$}}
+; CHECK-NEXT: .result i32{{$}}
+; CHECK-NEXT: .local
+define i32 @f4(i32 %x) {
+entry:
+ %c = trunc i32 %x to i1
+ br i1 %c, label %true, label %false
+true:
+ ret i32 0
+false:
+ ret i32 1
+}
+
+; CHECK-LABEL: f5:
+; CHECK-NEXT: .result f32{{$}}
+; CHECK-NEXT: unreachable
+define float @f5() {
+ unreachable
+}
OpenPOWER on IntegriCloud