From 874eedd779d9e447708d88529ea0beb77863328a Mon Sep 17 00:00:00 2001 From: Nicholas Wilson Date: Tue, 27 Mar 2018 17:38:51 +0000 Subject: [WebAssembly] Add export/import for function pointer table This enables callback-style programming where the JavaScript environment can call back into the Wasm environment using a function pointer received from the module. Differential Revision: https://reviews.llvm.org/D44427 llvm-svn: 328643 --- lld/test/wasm/import-table.test | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 lld/test/wasm/import-table.test (limited to 'lld/test/wasm/import-table.test') diff --git a/lld/test/wasm/import-table.test b/lld/test/wasm/import-table.test new file mode 100644 index 00000000000..98e07491ec4 --- /dev/null +++ b/lld/test/wasm/import-table.test @@ -0,0 +1,18 @@ +# RUN: llc -filetype=obj %p/Inputs/start.ll -o %t.start.o +# RUN: wasm-ld --check-signatures --import-table -o %t.wasm %t.start.o +# RUN: obj2yaml %t.wasm | FileCheck %s + +# Verify the --import-table flag creates a table import + +# CHECK: - Type: IMPORT +# CHECK-NEXT: Imports: +# CHECK-NEXT: - Module: env +# CHECK-NEXT: Field: __indirect_function_table +# CHECK-NEXT: Kind: TABLE +# CHECK-NEXT: Table: +# CHECK-NEXT: ElemType: ANYFUNC +# CHECK-NEXT: Limits: +# CHECK-NEXT: Flags: [ HAS_MAX ] +# CHECK-NEXT: Initial: 0x00000001 +# CHECK-NEXT: Maximum: 0x00000001 + -- cgit v1.2.1