mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-15 08:23:41 +00:00
main: add error tests for the compiler
The compiler can in fact return errors, but these weren't tested yet.
This commit is contained in:
committed by
Ron Evans
parent
a5f78a3900
commit
f4ce11ef37
@@ -17,6 +17,7 @@ import (
|
|||||||
func TestErrors(t *testing.T) {
|
func TestErrors(t *testing.T) {
|
||||||
for _, name := range []string{
|
for _, name := range []string{
|
||||||
"cgo",
|
"cgo",
|
||||||
|
"compiler",
|
||||||
"interp",
|
"interp",
|
||||||
"loader-importcycle",
|
"loader-importcycle",
|
||||||
"loader-invaliddep",
|
"loader-invaliddep",
|
||||||
|
|||||||
Vendored
+13
@@ -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
|
||||||
Reference in New Issue
Block a user