From a7ff120dd9c025f8a29987664be0f1b90b50f299 Mon Sep 17 00:00:00 2001 From: Brandon Fish Date: Thu, 8 Aug 2019 21:03:00 -0600 Subject: [PATCH] Fix some spectest imports and namespace_table issue --- lib/runtime-core/src/parse.rs | 12 +- lib/spectests/tests/excludes.txt | 266 +++++-------------------------- lib/spectests/tests/spectest.rs | 15 +- 3 files changed, 62 insertions(+), 231 deletions(-) diff --git a/lib/runtime-core/src/parse.rs b/lib/runtime-core/src/parse.rs index a5638b7e6..f482b10ca 100644 --- a/lib/runtime-core/src/parse.rs +++ b/lib/runtime-core/src/parse.rs @@ -98,7 +98,6 @@ pub fn read_module< use wasmparser::ParserState; let state = parser.read(); match *state { - ParserState::EndWasm => break, ParserState::Error(err) => Err(LoadError::Parse(err))?, ParserState::TypeSectionEntry(ref ty) => { info.write() @@ -369,7 +368,16 @@ pub fn read_module< info.write().unwrap().globals.push(global_init); } - + ParserState::EndWasm => { + if namespace_builder.is_some() { + info.write().unwrap().namespace_table = + namespace_builder.take().unwrap().finish(); + } + if name_builder.is_some() { + info.write().unwrap().name_table = name_builder.take().unwrap().finish(); + } + break; + } _ => {} } } diff --git a/lib/spectests/tests/excludes.txt b/lib/spectests/tests/excludes.txt index aa320f026..9a85a56ea 100644 --- a/lib/spectests/tests/excludes.txt +++ b/lib/spectests/tests/excludes.txt @@ -22,164 +22,48 @@ clif:skip:names.wast:* # Names file has parsing error? clif:skip:simd.wast:* # SIMD not implemented clif:skip:simd_binaryen.wast:* # SIMD not implemented -clif:fail:binary-leb128.wast:74 # Module - caught panic Any -clif:fail:binary-leb128.wast:86 # Module - caught panic Any -clif:fail:binary-leb128.wast:98 # Module - caught panic Any -clif:fail:data.wast:27 # Module - caught panic Any -clif:fail:data.wast:40 # Module - caught panic Any -clif:fail:data.wast:50 # Module - caught panic Any -clif:fail:data.wast:55 # Module - caught panic Any -clif:fail:data.wast:61 # Module - caught panic Any -clif:fail:data.wast:66 # Module - caught panic Any -clif:fail:data.wast:83 # Module - caught panic Any -clif:fail:data.wast:98 # Module - caught panic Any -clif:fail:data.wast:117 # Module - caught panic Any -clif:fail:data.wast:127 # Module - caught panic Any -clif:fail:data.wast:132 # Module - caught panic Any -clif:fail:data.wast:137 # Module - caught panic Any -clif:fail:data.wast:143 # Module - caught panic Any -clif:fail:data.wast:149 # Module - caught panic Any -clif:fail:data.wast:154 # Module - caught panic Any clif:fail:data.wast:186 # AssertUnlinkable - instantiate successful, expected unlinkable clif:fail:data.wast:194 # AssertUnlinkable - instantiate successful, expected unlinkable -clif:fail:data.wast:211 # AssertUnlinkable - caught panic Any -clif:fail:data.wast:227 # AssertUnlinkable - caught panic Any -clif:fail:data.wast:258 # AssertUnlinkable - caught panic Any -clif:fail:data.wast:273 # AssertUnlinkable - caught panic Any -clif:fail:elem.wast:101 # Module - caught panic Any clif:fail:elem.wast:143 # AssertUnlinkable - instantiate successful, expected unlinkable clif:fail:elem.wast:152 # AssertUnlinkable - caught panic Any clif:fail:elem.wast:161 # AssertUnlinkable - instantiate successful, expected unlinkable clif:fail:elem.wast:170 # AssertUnlinkable - instantiate successful, expected unlinkable clif:fail:elem.wast:178 # AssertUnlinkable - instantiate successful, expected unlinkable +clif:fail:elem.wast:186 # AssertUnlinkable - instantiate successful, expected unlinkable clif:fail:elem.wast:195 # AssertUnlinkable - instantiate successful, expected unlinkable +clif:fail:elem.wast:203 # AssertUnlinkable - instantiate successful, expected unlinkable clif:fail:elem.wast:212 # AssertUnlinkable - caught panic Any +clif:fail:elem.wast:220 # AssertUnlinkable - caught panic Any +clif:fail:elem.wast:237 # AssertUnlinkable - caught panic Any clif:fail:elem.wast:366 # AssertReturn - Call failed RuntimeError: WebAssembly trap occurred during runtime: `call_indirect` out-of-bounds clif:fail:elem.wast:367 # AssertReturn - result I32(65) ("0x41") does not match expected I32(68) ("0x44") clif:fail:elem.wast:379 # AssertReturn - Call failed RuntimeError: WebAssembly trap occurred during runtime: `call_indirect` out-of-bounds clif:fail:elem.wast:380 # AssertReturn - result I32(65) ("0x41") does not match expected I32(69) ("0x45") clif:fail:elem.wast:381 # AssertReturn - result I32(66) ("0x42") does not match expected I32(70) ("0x46") clif:fail:globals.wast:243 # AssertInvalid - Should be invalid -clif:fail:globals.wast:301 # Module - caught panic Any -clif:fail:imports.wast:98 # Module - caught panic Any -clif:fail:imports.wast:99 # Module - caught panic Any -clif:fail:imports.wast:100 # Module - caught panic Any -clif:fail:imports.wast:101 # Module - caught panic Any -clif:fail:imports.wast:102 # Module - caught panic Any -clif:fail:imports.wast:103 # Module - caught panic Any -clif:fail:imports.wast:104 # Module - caught panic Any -clif:fail:imports.wast:107 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:111 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:116 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:120 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:124 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:128 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:132 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:136 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:140 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:144 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:148 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:152 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:156 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:160 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:164 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:168 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:172 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:176 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:181 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:185 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:189 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:193 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:197 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:201 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:231 # Module - caught panic Any -clif:fail:imports.wast:232 # Module - caught panic Any -clif:fail:imports.wast:235 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:239 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:244 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:248 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:252 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:256 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:260 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:264 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:322 # Module - caught panic Any -clif:fail:imports.wast:323 # Module - caught panic Any -clif:fail:imports.wast:324 # Module - caught panic Any -clif:fail:imports.wast:325 # Module - caught panic Any -clif:fail:imports.wast:326 # Module - caught panic Any -clif:fail:imports.wast:327 # Module - caught panic Any -clif:fail:imports.wast:328 # Module - caught panic Any -clif:fail:imports.wast:329 # Module - caught panic Any -clif:fail:imports.wast:330 # Module - caught panic Any -clif:fail:imports.wast:331 # Module - caught panic Any -clif:fail:imports.wast:332 # Module - caught panic Any -clif:fail:imports.wast:335 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:339 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:344 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:348 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:352 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:356 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:361 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:365 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:369 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:373 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:417 # Module - caught panic Any -clif:fail:imports.wast:418 # Module - caught panic Any -clif:fail:imports.wast:419 # Module - caught panic Any -clif:fail:imports.wast:420 # Module - caught panic Any -clif:fail:imports.wast:421 # Module - caught panic Any -clif:fail:imports.wast:422 # Module - caught panic Any -clif:fail:imports.wast:423 # Module - caught panic Any -clif:fail:imports.wast:424 # Module - caught panic Any -clif:fail:imports.wast:425 # Module - caught panic Any -clif:fail:imports.wast:428 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:432 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:437 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:441 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:445 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:449 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:454 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:458 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:462 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:466 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:470 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:474 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:479 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:483 # AssertUnlinkable - caught panic Any -clif:fail:imports.wast:574 # AssertUnlinkable - caught panic Any -clif:fail:linking.wast:22 # Module - caught panic Any -clif:fail:linking.wast:26 # Register - No instance available -clif:fail:linking.wast:28 # AssertUnlinkable - caught panic Any -clif:fail:linking.wast:32 # AssertUnlinkable - caught panic Any clif:fail:linking.wast:81 # AssertReturn Get - Expected Global I32(241) got: I32(142) clif:fail:linking.wast:83 # AssertReturn - result I32(142) ("0x8e") does not match expected I32(241) ("0xf1") -clif:fail:linking.wast:87 # AssertUnlinkable - caught panic Any -clif:fail:linking.wast:91 # AssertUnlinkable - caught panic Any -clif:fail:linking.wast:137 # AssertTrap - expected trap, got Runtime:Error "unknown trap at 0x109d44062 - illegal instruction" -clif:fail:linking.wast:139 # AssertTrap - expected trap, got Runtime:Error "unknown trap at 0x109d44062 - illegal instruction" -clif:fail:linking.wast:142 # AssertTrap - expected trap, got Runtime:Error "unknown trap at 0x109d44062 - illegal instruction" -clif:fail:linking.wast:144 # AssertTrap - expected trap, got Runtime:Error "unknown trap at 0x109d44062 - illegal instruction" -clif:fail:linking.wast:147 # AssertTrap - expected trap, got Runtime:Error "unknown trap at 0x109d44037 - illegal instruction" -clif:fail:linking.wast:149 # AssertTrap - expected trap, got Runtime:Error "unknown trap at 0x109d44037 - illegal instruction" +clif:fail:linking.wast:137 # AssertTrap - expected trap, got Runtime:Error "unknown trap at 0x10c5ae062 - illegal instruction" +clif:fail:linking.wast:139 # AssertTrap - expected trap, got Runtime:Error "unknown trap at 0x10c5ae062 - illegal instruction" +clif:fail:linking.wast:142 # AssertTrap - expected trap, got Runtime:Error "unknown trap at 0x10c5ae062 - illegal instruction" +clif:fail:linking.wast:144 # AssertTrap - expected trap, got Runtime:Error "unknown trap at 0x10c5ae062 - illegal instruction" +clif:fail:linking.wast:147 # AssertTrap - expected trap, got Runtime:Error "unknown trap at 0x10c5ae037 - illegal instruction" +clif:fail:linking.wast:149 # AssertTrap - expected trap, got Runtime:Error "unknown trap at 0x10c5ae037 - illegal instruction" clif:fail:linking.wast:172 # AssertReturn - result I32(4) ("0x4") does not match expected I32(-4) ("0xfffffffc") clif:fail:linking.wast:173 # AssertReturn - result I32(4) ("0x4") does not match expected I32(-4) ("0xfffffffc") clif:fail:linking.wast:175 # AssertReturn - result I32(4) ("0x4") does not match expected I32(-4) ("0xfffffffc") clif:fail:linking.wast:178 # AssertReturn - Call failed RuntimeError: WebAssembly trap occurred during runtime: `call_indirect` out-of-bounds -clif:fail:linking.wast:179 # AssertReturn - Call failed RuntimeError: "unknown trap at 0x109d44062 - illegal instruction" -clif:fail:linking.wast:181 # AssertReturn - Call failed RuntimeError: "unknown trap at 0x109d44062 - illegal instruction" -clif:fail:linking.wast:185 # AssertTrap - expected trap, got Runtime:Error "unknown trap at 0x109d44062 - illegal instruction" -clif:fail:linking.wast:187 # AssertTrap - expected trap, got Runtime:Error "unknown trap at 0x109d44062 - illegal instruction" -clif:fail:linking.wast:200 # Module - caught panic Any -clif:fail:linking.wast:204 # AssertReturn Get - No instance available Some("$G2") +clif:fail:linking.wast:179 # AssertReturn - Call failed RuntimeError: "unknown trap at 0x10c5ae062 - illegal instruction" +clif:fail:linking.wast:181 # AssertReturn - Call failed RuntimeError: "unknown trap at 0x10c5ae062 - illegal instruction" +clif:fail:linking.wast:185 # AssertTrap - expected trap, got Runtime:Error "unknown trap at 0x10c5ae062 - illegal instruction" +clif:fail:linking.wast:187 # AssertTrap - expected trap, got Runtime:Error "unknown trap at 0x10c5ae062 - illegal instruction" +clif:fail:linking.wast:207 # AssertUnlinkable - instantiate successful, expected unlinkable +clif:fail:linking.wast:228 # AssertUnlinkable - instantiate successful, expected unlinkable clif:fail:linking.wast:288 # AssertReturn - result I32(2) ("0x2") does not match expected I32(167) ("0xa7") clif:fail:linking.wast:289 # AssertReturn - result I32(2) ("0x2") does not match expected I32(167) ("0xa7") -clif:fail:linking.wast:293 # Module - caught panic Any -clif:fail:linking.wast:299 # AssertUnlinkable - caught panic Any -clif:fail:linking.wast:324 # AssertUnlinkable - caught panic Any -clif:fail:linking.wast:335 # AssertUnlinkable - caught panic Any +clif:fail:linking.wast:345 # AssertUnlinkable - instantiate successful, expected unlinkable clif:fail:linking.wast:387 # AssertReturn - result I32(0) ("0x0") does not match expected I32(104) ("0x68") clif:fail:linking.wast:388 # AssertReturn - Call failed RuntimeError: WebAssembly trap occurred during runtime: `call_indirect` out-of-bounds -clif:fail:start.wast:92 # Module - caught panic Any # clif:skip:skip-stack-guard-page.wast:2 # Slow test @@ -952,46 +836,29 @@ llvm:fail:binary-leb128.wast:74 # Module - caught panic Any llvm:fail:binary-leb128.wast:86 # Module - caught panic Any llvm:fail:binary-leb128.wast:98 # Module - caught panic Any llvm:fail:binary.wast:446 # Module - caught panic Any -llvm:fail:data.wast:27 # Module - caught panic Any -llvm:fail:data.wast:40 # Module - caught panic Any -llvm:fail:data.wast:50 # Module - caught panic Any -llvm:fail:data.wast:55 # Module - caught panic Any -llvm:fail:data.wast:61 # Module - caught panic Any -llvm:fail:data.wast:66 # Module - caught panic Any -llvm:fail:data.wast:83 # Module - caught panic Any -llvm:fail:data.wast:98 # Module - caught panic Any -llvm:fail:data.wast:117 # Module - caught panic Any -llvm:fail:data.wast:127 # Module - caught panic Any -llvm:fail:data.wast:132 # Module - caught panic Any -llvm:fail:data.wast:137 # Module - caught panic Any -llvm:fail:data.wast:143 # Module - caught panic Any -llvm:fail:data.wast:149 # Module - caught panic Any -llvm:fail:data.wast:154 # Module - caught panic Any llvm:fail:data.wast:186 # AssertUnlinkable - instantiate successful, expected unlinkable llvm:fail:data.wast:194 # AssertUnlinkable - instantiate successful, expected unlinkable -llvm:fail:data.wast:211 # AssertUnlinkable - caught panic Any -llvm:fail:data.wast:227 # AssertUnlinkable - caught panic Any -llvm:fail:data.wast:258 # AssertUnlinkable - caught panic Any -llvm:fail:data.wast:273 # AssertUnlinkable - caught panic Any -llvm:fail:elem.wast:101 # Module - caught panic Any llvm:fail:elem.wast:143 # AssertUnlinkable - instantiate successful, expected unlinkable llvm:fail:elem.wast:152 # AssertUnlinkable - caught panic Any llvm:fail:elem.wast:161 # AssertUnlinkable - instantiate successful, expected unlinkable llvm:fail:elem.wast:170 # AssertUnlinkable - instantiate successful, expected unlinkable llvm:fail:elem.wast:178 # AssertUnlinkable - instantiate successful, expected unlinkable +llvm:fail:elem.wast:186 # AssertUnlinkable - instantiate successful, expected unlinkable llvm:fail:elem.wast:195 # AssertUnlinkable - instantiate successful, expected unlinkable +llvm:fail:elem.wast:203 # AssertUnlinkable - instantiate successful, expected unlinkable llvm:fail:elem.wast:212 # AssertUnlinkable - caught panic Any +llvm:fail:elem.wast:220 # AssertUnlinkable - caught panic Any +llvm:fail:elem.wast:237 # AssertUnlinkable - caught panic Any llvm:fail:elem.wast:366 # AssertReturn - Call failed RuntimeError: WebAssembly trap occurred during runtime: incorrect `call_indirect` signature llvm:fail:elem.wast:367 # AssertReturn - result I32(65) ("0x41") does not match expected I32(68) ("0x44") llvm:fail:elem.wast:379 # AssertReturn - Call failed RuntimeError: WebAssembly trap occurred during runtime: incorrect `call_indirect` signature llvm:fail:elem.wast:380 # AssertReturn - result I32(65) ("0x41") does not match expected I32(69) ("0x45") llvm:fail:elem.wast:381 # AssertReturn - result I32(66) ("0x42") does not match expected I32(70) ("0x46") llvm:fail:globals.wast:243 # AssertInvalid - caught panic Any -llvm:fail:globals.wast:301 # Module - caught panic Any -llvm:fail:i32.wast:243 # AssertReturn - result I32(79069519) ("0x4b6814f") does not match expected I32(32) ("0x20") -llvm:fail:i32.wast:252 # AssertReturn - result I32(79069536) ("0x4b68160") does not match expected I32(32) ("0x20") -llvm:fail:i64.wast:243 # AssertReturn - result I64(4374036975) ("0x104b681ef") does not match expected I64(64) ("0x40") -llvm:fail:i64.wast:252 # AssertReturn - result I64(4374036960) ("0x104b681e0") does not match expected I64(64) ("0x40") +llvm:fail:i32.wast:243 # AssertReturn - result I32(246100303) ("0xeab314f") does not match expected I32(32) ("0x20") +llvm:fail:i32.wast:252 # AssertReturn - result I32(246100320) ("0xeab3160") does not match expected I32(32) ("0x20") +llvm:fail:i64.wast:243 # AssertReturn - result I64(4541067759) ("0x10eab31ef") does not match expected I64(64) ("0x40") +llvm:fail:i64.wast:252 # AssertReturn - result I64(4541067744) ("0x10eab31e0") does not match expected I64(64) ("0x40") llvm:fail:imports.wast:98 # Module - caught panic Any llvm:fail:imports.wast:99 # Module - caught panic Any llvm:fail:imports.wast:100 # Module - caught panic Any @@ -1023,65 +890,11 @@ llvm:fail:imports.wast:189 # AssertUnlinkable - caught panic Any llvm:fail:imports.wast:193 # AssertUnlinkable - caught panic Any llvm:fail:imports.wast:197 # AssertUnlinkable - caught panic Any llvm:fail:imports.wast:201 # AssertUnlinkable - caught panic Any -llvm:fail:imports.wast:231 # Module - caught panic Any -llvm:fail:imports.wast:232 # Module - caught panic Any -llvm:fail:imports.wast:235 # AssertUnlinkable - caught panic Any -llvm:fail:imports.wast:239 # AssertUnlinkable - caught panic Any -llvm:fail:imports.wast:244 # AssertUnlinkable - caught panic Any -llvm:fail:imports.wast:248 # AssertUnlinkable - caught panic Any -llvm:fail:imports.wast:252 # AssertUnlinkable - caught panic Any -llvm:fail:imports.wast:256 # AssertUnlinkable - caught panic Any -llvm:fail:imports.wast:260 # AssertUnlinkable - caught panic Any -llvm:fail:imports.wast:264 # AssertUnlinkable - caught panic Any -llvm:fail:imports.wast:322 # Module - caught panic Any -llvm:fail:imports.wast:323 # Module - caught panic Any -llvm:fail:imports.wast:324 # Module - caught panic Any -llvm:fail:imports.wast:325 # Module - caught panic Any -llvm:fail:imports.wast:326 # Module - caught panic Any -llvm:fail:imports.wast:327 # Module - caught panic Any -llvm:fail:imports.wast:328 # Module - caught panic Any -llvm:fail:imports.wast:329 # Module - caught panic Any -llvm:fail:imports.wast:330 # Module - caught panic Any -llvm:fail:imports.wast:331 # Module - caught panic Any -llvm:fail:imports.wast:332 # Module - caught panic Any -llvm:fail:imports.wast:335 # AssertUnlinkable - caught panic Any -llvm:fail:imports.wast:339 # AssertUnlinkable - caught panic Any -llvm:fail:imports.wast:344 # AssertUnlinkable - caught panic Any -llvm:fail:imports.wast:348 # AssertUnlinkable - caught panic Any -llvm:fail:imports.wast:352 # AssertUnlinkable - caught panic Any -llvm:fail:imports.wast:356 # AssertUnlinkable - caught panic Any -llvm:fail:imports.wast:361 # AssertUnlinkable - caught panic Any -llvm:fail:imports.wast:365 # AssertUnlinkable - caught panic Any -llvm:fail:imports.wast:369 # AssertUnlinkable - caught panic Any -llvm:fail:imports.wast:373 # AssertUnlinkable - caught panic Any -llvm:fail:imports.wast:417 # Module - caught panic Any -llvm:fail:imports.wast:418 # Module - caught panic Any -llvm:fail:imports.wast:419 # Module - caught panic Any -llvm:fail:imports.wast:420 # Module - caught panic Any -llvm:fail:imports.wast:421 # Module - caught panic Any -llvm:fail:imports.wast:422 # Module - caught panic Any -llvm:fail:imports.wast:423 # Module - caught panic Any -llvm:fail:imports.wast:424 # Module - caught panic Any -llvm:fail:imports.wast:425 # Module - caught panic Any -llvm:fail:imports.wast:428 # AssertUnlinkable - caught panic Any -llvm:fail:imports.wast:432 # AssertUnlinkable - caught panic Any -llvm:fail:imports.wast:437 # AssertUnlinkable - caught panic Any -llvm:fail:imports.wast:441 # AssertUnlinkable - caught panic Any -llvm:fail:imports.wast:445 # AssertUnlinkable - caught panic Any -llvm:fail:imports.wast:449 # AssertUnlinkable - caught panic Any -llvm:fail:imports.wast:454 # AssertUnlinkable - caught panic Any -llvm:fail:imports.wast:458 # AssertUnlinkable - caught panic Any -llvm:fail:imports.wast:462 # AssertUnlinkable - caught panic Any -llvm:fail:imports.wast:466 # AssertUnlinkable - caught panic Any -llvm:fail:imports.wast:470 # AssertUnlinkable - caught panic Any -llvm:fail:imports.wast:474 # AssertUnlinkable - caught panic Any -llvm:fail:imports.wast:479 # AssertUnlinkable - caught panic Any -llvm:fail:imports.wast:483 # AssertUnlinkable - caught panic Any -llvm:fail:imports.wast:491 # AssertReturn - No instance available: None -llvm:fail:imports.wast:492 # AssertReturn - No instance available: None -llvm:fail:imports.wast:493 # AssertReturn - No instance available: None -llvm:fail:imports.wast:494 # AssertReturn - No instance available: None -llvm:fail:imports.wast:495 # AssertReturn - No instance available: None +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:imports.wast:574 # AssertUnlinkable - caught panic Any llvm:fail:linking.wast:22 # Module - caught panic Any llvm:fail:linking.wast:26 # Register - No instance available @@ -1089,20 +902,16 @@ llvm:fail:linking.wast:28 # AssertUnlinkable - caught panic Any llvm:fail:linking.wast:32 # AssertUnlinkable - caught panic Any llvm:fail:linking.wast:81 # AssertReturn Get - Expected Global I32(241) got: I32(142) llvm:fail:linking.wast:83 # AssertReturn - result I32(142) ("0x8e") does not match expected I32(241) ("0xf1") -llvm:fail:linking.wast:87 # AssertUnlinkable - caught panic Any -llvm:fail:linking.wast:91 # AssertUnlinkable - caught panic Any llvm:fail:linking.wast:172 # AssertReturn - result I32(4) ("0x4") does not match expected I32(-4) ("0xfffffffc") llvm:fail:linking.wast:173 # AssertReturn - result I32(4) ("0x4") does not match expected I32(-4) ("0xfffffffc") llvm:fail:linking.wast:175 # AssertReturn - result I32(4) ("0x4") does not match expected I32(-4) ("0xfffffffc") llvm:fail:linking.wast:178 # AssertReturn - Call failed RuntimeError: WebAssembly trap occurred during runtime: incorrect `call_indirect` signature llvm:fail:linking.wast:179 # AssertReturn - Call failed RuntimeError: WebAssembly trap occurred during runtime: incorrect `call_indirect` signature llvm:fail:linking.wast:181 # AssertReturn - Call failed RuntimeError: WebAssembly trap occurred during runtime: incorrect `call_indirect` signature -llvm:fail:linking.wast:200 # Module - caught panic Any -llvm:fail:linking.wast:204 # AssertReturn Get - No instance available Some("$G2") +llvm:fail:linking.wast:207 # AssertUnlinkable - instantiate successful, expected unlinkable +llvm:fail:linking.wast:228 # AssertUnlinkable - instantiate successful, expected unlinkable llvm:fail:linking.wast:288 # AssertReturn - result I32(2) ("0x2") does not match expected I32(167) ("0xa7") llvm:fail:linking.wast:289 # AssertReturn - result I32(2) ("0x2") does not match expected I32(167) ("0xa7") -llvm:fail:linking.wast:293 # Module - caught panic Any -llvm:fail:linking.wast:299 # AssertUnlinkable - caught panic Any 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") @@ -1112,10 +921,10 @@ 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:linking.wast:324 # AssertUnlinkable - caught panic Any -llvm:fail:linking.wast:335 # AssertUnlinkable - caught panic Any +llvm:fail:linking.wast:345 # AssertUnlinkable - instantiate successful, expected unlinkable 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(80568351) ("0x4cd601f") does not match expected I32(32) ("0x20") +llvm:fail:load.wast:201 # AssertReturn - result I32(291901471) ("0x1166101f") does not match expected I32(32) ("0x20") llvm:fail:start.wast:92 # Module - caught panic Any llvm:fail:type.wast:3 # Module - caught panic Any @@ -1350,8 +1159,12 @@ singlepass:fail:elem.wast:152 # AssertUnlinkable - caught panic Any singlepass:fail:elem.wast:161 # AssertUnlinkable - instantiate successful, expected unlinkable singlepass:fail:elem.wast:170 # AssertUnlinkable - caught panic Any singlepass:fail:elem.wast:178 # AssertUnlinkable - instantiate successful, expected unlinkable +singlepass:fail:elem.wast:186 # AssertUnlinkable - instantiate successful, expected unlinkable singlepass:fail:elem.wast:195 # AssertUnlinkable - instantiate successful, expected unlinkable +singlepass:fail:elem.wast:203 # AssertUnlinkable - instantiate successful, expected unlinkable singlepass:fail:elem.wast:212 # AssertUnlinkable - caught panic Any +singlepass:fail:elem.wast:220 # AssertUnlinkable - caught panic Any +singlepass:fail:elem.wast:237 # AssertUnlinkable - caught panic Any singlepass:fail:elem.wast:353 # AssertTrap - expected trap, got Runtime:Error unknown error singlepass:fail:elem.wast:366 # AssertReturn - Call failed RuntimeError: unknown error singlepass:fail:elem.wast:367 # AssertReturn - result I32(65) ("0x41") does not match expected I32(68) ("0x44") @@ -2014,7 +1827,9 @@ singlepass:fail:linking.wast:198 # Module - caught panic Any singlepass:fail:linking.wast:199 # Register - No instance available singlepass:fail:linking.wast:200 # Module - caught panic Any singlepass:fail:linking.wast:204 # AssertReturn Get - No instance available Some("$G2") +singlepass:fail:linking.wast:207 # AssertUnlinkable - instantiate successful, expected unlinkable singlepass:fail:linking.wast:225 # AssertTrap - expected trap, got Runtime:Error unknown error +singlepass:fail:linking.wast:228 # AssertUnlinkable - instantiate successful, expected unlinkable singlepass:fail:linking.wast:236 # AssertTrap - expected trap, got Runtime:Error unknown error singlepass:fail:linking.wast:248 # AssertTrap - expected trap, got Runtime:Error unknown error singlepass:fail:linking.wast:288 # AssertReturn - result I32(2) ("0x2") does not match expected I32(167) ("0xa7") @@ -2023,6 +1838,7 @@ singlepass:fail:linking.wast:293 # Module - caught panic Any singlepass:fail:linking.wast:299 # AssertUnlinkable - caught panic Any singlepass:fail:linking.wast:324 # AssertUnlinkable - caught panic Any singlepass:fail:linking.wast:335 # AssertUnlinkable - caught panic Any +singlepass:fail:linking.wast:345 # AssertUnlinkable - instantiate successful, expected unlinkable singlepass:fail:linking.wast:387 # AssertReturn - result I32(0) ("0x0") does not match expected I32(104) ("0x68") singlepass:fail:linking.wast:388 # AssertReturn - Call failed RuntimeError: unknown error singlepass:fail:load.wast:201 # AssertReturn - result I32(0) ("0x0") does not match expected I32(32) ("0x20") diff --git a/lib/spectests/tests/spectest.rs b/lib/spectests/tests/spectest.rs index 0431c9f22..0d0dd5fd4 100644 --- a/lib/spectests/tests/spectest.rs +++ b/lib/spectests/tests/spectest.rs @@ -795,7 +795,9 @@ mod tests { } } CommandKind::AssertUnlinkable { module, message: _ } => { - let result = panic::catch_unwind(|| { + let result = panic::catch_unwind(AssertUnwindSafe(|| { + let spectest_import_object = + get_spectest_import_object(®istered_modules); let config = CompilerConfig { features: Features { simd: true }, ..Default::default() @@ -806,8 +808,8 @@ mod tests { config, ) .expect("WASM can't be compiled"); - module.instantiate(&ImportObject::new()) - }); + module.instantiate(&spectest_import_object) + })); match result { Err(e) => { test_report.add_failure( @@ -985,6 +987,10 @@ mod tests { } } + fn print(_ctx: &mut Ctx) { + println!(""); + } + fn print_i32(_ctx: &mut Ctx, val: i32) { println!("{}", val); } @@ -1025,6 +1031,7 @@ mod tests { .unwrap(); let mut import_object = imports! { "spectest" => { + "print" => func!(print), "print_i32" => func!(print_i32), "print_f32" => func!(print_f32), "print_f64" => func!(print_f64), @@ -1041,7 +1048,7 @@ mod tests { for (name, module) in registered_modules.iter() { let i = module - .instantiate(&ImportObject::new()) + .instantiate(&import_object) .expect("Registered WASM can't be instantiated"); import_object.register(name.clone(), i); }