mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-07-26 06:38:42 +00:00
main: add test for error coming from the optimizer
This is just one optimizer pass that's easy to test for. There are others, but I'm ignoring them for now. The one other that would be reasonable to test is when starting a goroutine with -gc=none, but I'm leaving that one for another time.
This commit is contained in:
committed by
Ron Evans
parent
f4ce11ef37
commit
3788b31ba5
@@ -23,6 +23,7 @@ func TestErrors(t *testing.T) {
|
||||
"loader-invaliddep",
|
||||
"loader-invalidpackage",
|
||||
"loader-nopackage",
|
||||
"optimizer",
|
||||
"syntax",
|
||||
"types",
|
||||
} {
|
||||
|
||||
Vendored
+18
@@ -0,0 +1,18 @@
|
||||
package main
|
||||
|
||||
import "runtime/interrupt"
|
||||
|
||||
var num = 5
|
||||
|
||||
func main() {
|
||||
// Error coming from LowerInterrupts.
|
||||
interrupt.New(num, func(interrupt.Interrupt) {
|
||||
})
|
||||
|
||||
// 2nd error
|
||||
interrupt.New(num, func(interrupt.Interrupt) {
|
||||
})
|
||||
}
|
||||
|
||||
// ERROR: optimizer.go:9:15: interrupt ID is not a constant
|
||||
// ERROR: optimizer.go:13:15: interrupt ID is not a constant
|
||||
Reference in New Issue
Block a user