Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing LLVM imported memory functions #675

Merged
merged 1 commit into from
Aug 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/llvm-backend/src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 _,

Expand Down
26 changes: 5 additions & 21 deletions lib/spectests/tests/excludes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down