1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 12:43:36 +01:00
llvm-mirror/test/MC/WebAssembly/tail-call-encodings.s
Andy Wingo 159bb43ce8 [WebAssembly] Swap operand order of call_indirect in text format
The WebAssembly text and binary formats have different operand orders
for the "type" and "table" fields of call_indirect (and
return_call_indirect).  In LLVM we use the binary order for the MCInstr,
but when we produce or consume the text format we should use the text
order.  For compilation units targetting WebAssembly 1.0 (without the
reference types feature), we omit the table operand entirely.

Differential Revision: https://reviews.llvm.org/D97761
2021-03-03 08:51:21 +01:00

26 lines
836 B
ArmAsm

# RUN: llvm-mc -show-encoding -triple=wasm32-unknown-unknown -mattr=+tail-call < %s | FileCheck %s
# RUN: llvm-mc -show-encoding -triple=wasm32-unknown-unknown -mattr=+reference-types,+tail-call < %s | FileCheck --check-prefix=REF %s
bar1:
.functype bar1 () -> ()
end_function
foo1:
.functype foo1 () -> ()
# CHECK: return_call bar1 # encoding: [0x12,
# CHECK-NEXT: fixup A - offset: 1, value: bar1, kind: fixup_uleb128_i32
return_call bar1
end_function
foo2:
.functype foo2 () -> ()
# REF: return_call_indirect __indirect_function_table, (i32) -> (i32) # encoding: [0x13,
# CHECK: return_call_indirect (i32) -> (i32) # encoding: [0x13,
# CHECK-NEXT: fixup A - offset: 1, value: .Ltypeindex0@TYPEINDEX, kind: fixup_uleb128_i32
return_call_indirect (i32) -> (i32)
end_function