From 0bf33662d1ca92956f95ba6cc38008f848e94108 Mon Sep 17 00:00:00 2001 From: Brandon Fish Date: Tue, 13 Aug 2019 20:07:55 -0600 Subject: [PATCH] Add missing LLVM imported memory functions --- lib/llvm-backend/src/backend.rs | 5 +++++ lib/spectests/tests/excludes.txt | 26 +++++--------------------- 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/lib/llvm-backend/src/backend.rs b/lib/llvm-backend/src/backend.rs index 763a7b34879..92f0f06a134 100644 --- a/lib/llvm-backend/src/backend.rs +++ b/lib/llvm-backend/src/backend.rs @@ -105,6 +105,11 @@ fn get_callbacks() -> Callbacks { fn_name!("vm.memory.grow.static.local") => vmcalls::local_static_memory_grow as _, fn_name!("vm.memory.size.static.local") => vmcalls::local_static_memory_size as _, + fn_name!("vm.memory.grow.dynamic.import") => vmcalls::imported_dynamic_memory_grow as _, + fn_name!("vm.memory.size.dynamic.import") => vmcalls::imported_dynamic_memory_size as _, + fn_name!("vm.memory.grow.static.import") => vmcalls::imported_static_memory_grow as _, + fn_name!("vm.memory.size.static.import") => vmcalls::imported_static_memory_size as _, + fn_name!("vm.exception.trap") => throw_trap as _, fn_name!("vm.breakpoint") => throw_breakpoint as _, diff --git a/lib/spectests/tests/excludes.txt b/lib/spectests/tests/excludes.txt index ae3cc7fef57..bfa255a14a5 100644 --- a/lib/spectests/tests/excludes.txt +++ b/lib/spectests/tests/excludes.txt @@ -815,8 +815,6 @@ llvm:skip:f64.wast:2418 llvm:skip:br_table.wast:1255 llvm:skip:imports.wast:391 # Running forever llvm:skip:imports.wast:402 # Running forever -llvm:skip:imports.wast:487 # LLVM ERROR: Program used external function '_vm.memory.grow.static.import' which could not be resolved! -llvm:skip:linking.wast:306 # LLVM ERROR: Program used external function '_vm.memory.grow.static.import' which could not be resolved! llvm:skip:call.wast:273 # Spec running forever llvm:skip:call_indirect.wast:556 # Spec running forever llvm:skip:call_indirect.wast:557 # Spec running forever @@ -825,27 +823,13 @@ llvm:skip:skip-stack-guard-page.wast:* # Spec running forever or (signal: 4, SIG llvm:skip:linking.wast:236 # terminating with uncaught exception of type WasmTrap llvm:skip:linking.wast:248 # terminating with uncaught exception of type WasmTrap -llvm:fail:i32.wast:243 # AssertReturn - result I32(61374799) ("0x3a8814f") does not match expected I32(32) ("0x20") -llvm:fail:i32.wast:252 # AssertReturn - result I32(61374816) ("0x3a88160") does not match expected I32(32) ("0x20") -llvm:fail:i64.wast:243 # AssertReturn - result I64(4356342255) ("0x103a881ef") does not match expected I64(64) ("0x40") -llvm:fail:i64.wast:252 # AssertReturn - result I64(4356342240) ("0x103a881e0") does not match expected I64(64) ("0x40") -llvm:fail:imports.wast:491 # AssertReturn - Call failed ResolveError: ExportNotFound { name: "grow" } -llvm:fail:imports.wast:492 # AssertReturn - Call failed ResolveError: ExportNotFound { name: "grow" } -llvm:fail:imports.wast:493 # AssertReturn - Call failed ResolveError: ExportNotFound { name: "grow" } -llvm:fail:imports.wast:494 # AssertReturn - Call failed ResolveError: ExportNotFound { name: "grow" } -llvm:fail:imports.wast:495 # AssertReturn - Call failed ResolveError: ExportNotFound { name: "grow" } -llvm:fail:linking.wast:314 # AssertReturn - No instance available: Some("$Pm") -llvm:fail:linking.wast:315 # AssertReturn - No instance available: Some("$Pm") -llvm:fail:linking.wast:316 # AssertReturn - No instance available: Some("$Pm") -llvm:fail:linking.wast:317 # AssertReturn - No instance available: Some("$Pm") -llvm:fail:linking.wast:318 # AssertReturn - No instance available: Some("$Pm") -llvm:fail:linking.wast:319 # AssertReturn - No instance available: Some("$Pm") -llvm:fail:linking.wast:320 # AssertReturn - No instance available: Some("$Pm") -llvm:fail:linking.wast:321 # AssertReturn - No instance available: Some("$Pm") +llvm:fail:i32.wast:243 # AssertReturn - result I32(270618959) ("0x1021514f") does not match expected I32(32) ("0x20") +llvm:fail:i32.wast:252 # AssertReturn - result I32(270618976) ("0x10215160") does not match expected I32(32) ("0x20") +llvm:fail:i64.wast:243 # AssertReturn - result I64(4565586415) ("0x1102151ef") does not match expected I64(64) ("0x40") +llvm:fail:i64.wast:252 # AssertReturn - result I64(4565586400) ("0x1102151e0") does not match expected I64(64) ("0x40") llvm:fail:linking.wast:387 # AssertReturn - result I32(0) ("0x0") does not match expected I32(104) ("0x68") llvm:fail:linking.wast:388 # AssertReturn - Call failed RuntimeError: WebAssembly trap occurred during runtime: incorrect `call_indirect` signature -llvm:fail:load.wast:201 # AssertReturn - result I32(66175007) ("0x3f1c01f") does not match expected I32(32) ("0x20") - +llvm:fail:load.wast:201 # AssertReturn - result I32(272117791) ("0x1038301f") does not match expected I32(32) ("0x20") # LLVM Windows llvm:skip:address.wast:*:windows