1
0
mirror of https://github.com/golang/go synced 2024-10-01 04:18:33 -06:00

go/analysis/passes/ctrlflow: add test of modularity

See the Modularity section of the design doc:
https://docs.google.com/document/d/1-azPLXaLgTCKeKDNg0HVMq2ovMlD-e7n1ZHzZVzOlJk#heading=h.s7mcpao0dpqu

Change-Id: I83e6df01691964703a07a47c222101f3307a0dc6
Reviewed-on: https://go-review.googlesource.com/c/140759
Reviewed-by: Michael Matloob <matloob@golang.org>
Run-TryBot: Michael Matloob <matloob@golang.org>
This commit is contained in:
Alan Donovan 2018-10-09 10:33:47 -04:00
parent 8149dec50d
commit 157aeed469
2 changed files with 18 additions and 0 deletions

View File

@ -8,6 +8,8 @@ import (
"runtime"
"syscall"
"testing"
"lib"
)
var cond bool
@ -97,3 +99,11 @@ func spurious() { // want spurious:"noReturn"
}
func noBody()
func g() {
lib.CanReturn()
}
func h() { // want h:"noReturn"
lib.NoReturn()
}

View File

@ -0,0 +1,8 @@
package lib
func CanReturn() {}
func NoReturn() {
for {
}
}