1 ; RUN: llc < %s -asm-verbose=false -mattr=-reference-types -O2 | FileCheck --check-prefixes=CHECK,NOREF %s
2 ; RUN: llc < %s -asm-verbose=false -mattr=+reference-types -O2 | FileCheck --check-prefixes=CHECK,REF %s
3 ; RUN: llc < %s -asm-verbose=false -O2 --filetype=obj | obj2yaml | FileCheck --check-prefix=OBJ %s
5 ; Test that compilation units with call_indirect but without any
6 ; function pointer declarations still get a table.
8 target triple = "wasm32-unknown-unknown"
10 ; CHECK-LABEL: call_indirect_void:
11 ; CHECK-NEXT: .functype call_indirect_void (i32) -> ()
12 ; CHECK-NEXT: local.get 0
13 ; REF: call_indirect __indirect_function_table, () -> ()
14 ; NOREF: call_indirect () -> ()
15 ; CHECK-NEXT: end_function
16 define void @call_indirect_void(ptr %callee) {
22 ; OBJ-NEXT: - Module: env
23 ; OBJ-NEXT: Field: __linear_memory
24 ; OBJ-NEXT: Kind: MEMORY
26 ; OBJ-NEXT: Minimum: 0x0
27 ; OBJ-NEXT: - Module: env
28 ; OBJ-NEXT: Field: __indirect_function_table
29 ; OBJ-NEXT: Kind: TABLE