Thomas Lively | eafe8ef | 2019-05-23 17:26:47 +0000 | [diff] [blame^] | 1 | ; 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 |
| 2 | |
| 3 | ; Test that the tail-call attribute is accepted |
| 4 | ; TODO(tlively): implement tail call |
| 5 | |
| 6 | target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128" |
| 7 | target triple = "wasm32-unknown-unknown" |
| 8 | |
| 9 | ; CHECK-LABEL: recursive_tail: |
| 10 | ; CHECK: i32.call $push[[L0:[0-9]+]]=, recursive_tail{{$}} |
| 11 | ; CHECK-NEXT: return $pop[[L0]]{{$}} |
| 12 | define i32 @recursive_tail() { |
| 13 | %v = tail call i32 @recursive_tail() |
| 14 | ret i32 %v |
| 15 | } |
| 16 | |
| 17 | ; CHECK-LABEL: .section .custom_section.target_features |
| 18 | ; CHECK-NEXT: .int8 1 |
| 19 | ; CHECK-NEXT: .int8 43 |
| 20 | ; CHECK-NEXT: .int8 9 |
| 21 | ; CHECK-NEXT: .ascii "tail-call" |