aboutsummaryrefslogtreecommitdiffhomepage
path: root/testdata/wasmexport-noscheduler.go
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2024-10-30 12:12:10 +0100
committerAyke <[email protected]>2024-11-08 11:55:38 +0100
commit04a7baec3ede3d91243cfc73916b0b237a93e3fe (patch)
treeb4681f71a2a82e5125526ffa184222c9a0608e0c /testdata/wasmexport-noscheduler.go
parent8ff97bdedd5dc420462943dffe662bae57b6d567 (diff)
downloadtinygo-04a7baec3ede3d91243cfc73916b0b237a93e3fe.tar.gz
tinygo-04a7baec3ede3d91243cfc73916b0b237a93e3fe.zip
wasm: support `//go:wasmexport` functions after a call to `time.Sleep`
This fixes a bug where `//go:wasmexport` functions would not be allowed anymore after a call to `time.Sleep` (when using `-buildmode=default`).
Diffstat (limited to 'testdata/wasmexport-noscheduler.go')
-rw-r--r--testdata/wasmexport-noscheduler.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/testdata/wasmexport-noscheduler.go b/testdata/wasmexport-noscheduler.go
index b996b2faa..cc99d7136 100644
--- a/testdata/wasmexport-noscheduler.go
+++ b/testdata/wasmexport-noscheduler.go
@@ -1,5 +1,7 @@
package main
+import "time"
+
func init() {
println("called init")
}
@@ -8,6 +10,10 @@ func init() {
func callTestMain()
func main() {
+ // Check that exported functions can still be called after calling
+ // time.Sleep.
+ time.Sleep(time.Millisecond)
+
// main.main is not used when using -buildmode=c-shared.
callTestMain()
}