aboutsummaryrefslogtreecommitdiffhomepage
path: root/testdata/errors/interp.go
blob: a3f5cee78e46cc238391f054bc77b233d5c0197d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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"{{.*}}