-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add failing test call-imported-from-other
- Loading branch information
1 parent
1814545
commit 73ef766
Showing
3 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
EC;1;callImportedTwice; | ||
IC;0 | ||
EC;1;callImportedTwice; | ||
IC;0 | ||
IR;0; | ||
IC;0 | ||
EC;2;noop; | ||
IR;0; | ||
IR;0; | ||
IC;0 | ||
IR;0; | ||
ER |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>WebAssembly Test</title> | ||
</head> | ||
|
||
<body> | ||
<script> | ||
(async function () { | ||
const startTime = performance.now(); | ||
let instance; | ||
let counter_200 = 0 | ||
function imported() { | ||
counter_200 += 1 | ||
if (counter_200 === 1) { | ||
instance.exports.callImportedTwice(); | ||
} else if (counter_200 === 2) { | ||
} else if (counter_200 == 3) { | ||
instance.exports.noop(); | ||
} | ||
{ | ||
return | ||
} | ||
} | ||
let imports = { | ||
env: { | ||
imported: imported, | ||
}, | ||
}; | ||
const indexResponse = await fetch("index.wasm"); | ||
const indexBinary = await indexResponse.arrayBuffer(); | ||
let wasm = await WebAssembly.instantiate(indexBinary, imports); | ||
instance = wasm.instance; | ||
instance.exports.callImportedTwice(); | ||
const endTime = performance.now(); | ||
const executionTime = endTime - startTime; | ||
const executionTimeElement = document.createElement('p'); | ||
executionTimeElement.textContent = `Execution time: ${executionTime} milliseconds`; | ||
document.body.appendChild(executionTimeElement); | ||
})(); | ||
</script> | ||
</body> | ||
|
||
</html> |
Binary file not shown.