-
Notifications
You must be signed in to change notification settings - Fork 4
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-different-counter
- Loading branch information
1 parent
3824127
commit de642a1
Showing
3 changed files
with
60 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 | ||
IR;0; | ||
EC;2;noop; | ||
IR;0; | ||
IC;0 | ||
IR;0; | ||
ER |
48 changes: 48 additions & 0 deletions
48
tests/core/call-imported-different-counter/website/index.html
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,48 @@ | ||
<!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) { | ||
} else if (counter_200 === 2) { | ||
instance.exports.callImportedTwice(); | ||
instance.exports.noop(); | ||
} else if (counter_200 == 3) { | ||
} | ||
{ | ||
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; | ||
imported() | ||
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.