mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-07-26 14:48:40 +00:00
a5f78a3900
This one needed more advanced checking of the error messages, because we don't want to hardcode things like `!dbg !10` in the output.
32 lines
757 B
Go
32 lines
757 B
Go
package main
|
|
|
|
import _ "unsafe"
|
|
|
|
func init() {
|
|
foo()
|
|
}
|
|
|
|
func foo() {
|
|
interp_test_error()
|
|
}
|
|
|
|
// This is a function that always causes an error in interp, for testing.
|
|
//
|
|
//go:linkname interp_test_error __tinygo_interp_raise_test_error
|
|
func interp_test_error()
|
|
|
|
func main() {
|
|
}
|
|
|
|
// ERROR: # main
|
|
// ERROR: {{.*testdata[\\/]errors[\\/]interp\.go}}:10:19: test error
|
|
// ERROR: call void @__tinygo_interp_raise_test_error{{.*}}
|
|
// ERROR: {{}}
|
|
// ERROR: traceback:
|
|
// ERROR: {{.*testdata[\\/]errors[\\/]interp\.go}}:10:19:
|
|
// ERROR: call void @__tinygo_interp_raise_test_error{{.*}}
|
|
// ERROR: {{.*testdata[\\/]errors[\\/]interp\.go}}:6:5:
|
|
// ERROR: call void @main.foo{{.*}}
|
|
// ERROR: {{.*testdata[\\/]errors}}:
|
|
// ERROR: call void @"main.init#1"{{.*}}
|