aboutsummaryrefslogtreecommitdiffhomepage
path: root/testdata
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2024-07-12 17:05:04 +0200
committerRon Evans <[email protected]>2024-07-20 14:30:34 +0200
commitf4ce11ef37ea155ccf04e43590739a893b98a865 (patch)
tree77f43c5444c069bbf255817d8fb292f59bd678ea /testdata
parenta5f78a390065204d161fa80d0cfa83f9d0268d85 (diff)
downloadtinygo-f4ce11ef37ea155ccf04e43590739a893b98a865.tar.gz
tinygo-f4ce11ef37ea155ccf04e43590739a893b98a865.zip
main: add error tests for the compiler
The compiler can in fact return errors, but these weren't tested yet.
Diffstat (limited to 'testdata')
-rw-r--r--testdata/errors/compiler.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/testdata/errors/compiler.go b/testdata/errors/compiler.go
new file mode 100644
index 000000000..fb0057c93
--- /dev/null
+++ b/testdata/errors/compiler.go
@@ -0,0 +1,13 @@
+package main
+
+//go:wasmimport foo bar
+func foo() {
+}
+
+//go:align 7
+var global int
+
+// TODO: include package name in the error message
+
+// ERROR: compiler.go:4:6: can only use //go:wasmimport on declarations
+// ERROR: compiler.go:8:5: global variable alignment must be a positive power of two