Files
archived-llvm/test/CodeGen/WebAssembly/tailcall.ll
Thomas Lively dd5b336ef6 [WebAssembly] Add multivalue and tail-call target features
Summary:
These features will both be implemented soon, so I thought I would
save time by adding the boilerplate for both of them at the same time.

Reviewers: aheejin

Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D62047

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361516 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-23 17:26:47 +00:00

22 lines
736 B
LLVM

; RUN: llc < %s -asm-verbose=false -verify-machineinstrs -disable-wasm-fallthrough-return-opt -wasm-disable-explicit-locals -wasm-keep-registers -mattr=+tail-call | FileCheck %s
; Test that the tail-call attribute is accepted
; TODO(tlively): implement tail call
target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
target triple = "wasm32-unknown-unknown"
; CHECK-LABEL: recursive_tail:
; CHECK: i32.call $push[[L0:[0-9]+]]=, recursive_tail{{$}}
; CHECK-NEXT: return $pop[[L0]]{{$}}
define i32 @recursive_tail() {
%v = tail call i32 @recursive_tail()
ret i32 %v
}
; CHECK-LABEL: .section .custom_section.target_features
; CHECK-NEXT: .int8 1
; CHECK-NEXT: .int8 43
; CHECK-NEXT: .int8 9
; CHECK-NEXT: .ascii "tail-call"