go.tools/ssa: fix ssa tests (fix build partly)

R=adonovan
CC=golang-dev
https://golang.org/cl/13668048
This commit is contained in:
Robert Griesemer 2013-09-18 11:39:55 -07:00
parent a24d794bb1
commit 2695d311b9
2 changed files with 8 additions and 2 deletions

View File

@ -90,6 +90,7 @@ func main() {
v9 := S{} // &v9::Alloc v9 := S{} // &v9::Alloc
v10 := &v9 // v10::Alloc &v9::Alloc v10 := &v9 // v10::Alloc &v9::Alloc
_ = v10 // v10::Alloc
var v11 *J = nil // v11::Const var v11 *J = nil // v11::Const
v11.method() // v11::Const v11.method() // v11::Const
@ -115,6 +116,7 @@ func main() {
} }
for k, v := range m { // k::Extract v::Extract m::MakeMap for k, v := range m { // k::Extract v::Extract m::MakeMap
_ = k // k::Extract
v++ // v::BinOp v++ // v::BinOp
} }
@ -131,6 +133,7 @@ func main() {
ch := make(chan int) // ch::MakeChan ch := make(chan int) // ch::MakeChan
select { select {
case x := <-ch: // x::UnOp (receive) ch::MakeChan case x := <-ch: // x::UnOp (receive) ch::MakeChan
_ = x // x::UnOp
} }
// .Op is an inter-package FieldVal-selection. // .Op is an inter-package FieldVal-selection.

View File

@ -2,7 +2,7 @@
package main package main
// This file is the input to TestCanonicalPos in source_test.go, which // This file is the input to TestValueForExpr in source_test.go, which
// ensures that each expression e immediately following a /*@kind*/(x) // ensures that each expression e immediately following a /*@kind*/(x)
// annotation, when passed to Function.ValueForExpr(e), returns a // annotation, when passed to Function.ValueForExpr(e), returns a
// non-nil Value of the same type as e and of kind 'kind'. // non-nil Value of the same type as e and of kind 'kind'.
@ -14,9 +14,11 @@ func f(param int) {
ch := /*@MakeChan*/ (make(chan int)) ch := /*@MakeChan*/ (make(chan int))
/*@UnOp*/ (<-ch) /*@UnOp*/ (<-ch)
x := /*@UnOp*/ (<-ch) x := /*@UnOp*/ (<-ch)
_ = x
select { select {
case /*@Extract*/ (<-ch): case /*@Extract*/ (<-ch):
case x := /*@Extract*/ (<-ch): case x := /*@Extract*/ (<-ch):
_ = x
} }
defer /*@Function*/ (func() { defer /*@Function*/ (func() {
})() })()
@ -28,6 +30,7 @@ func f(param int) {
} }
_ = /*@Phi*/ (y) _ = /*@Phi*/ (y)
map1 := /*@MakeMap*/ (make(map[string]string)) map1 := /*@MakeMap*/ (make(map[string]string))
_ = map1
_ = /*@MakeMap*/ (map[string]string{"": ""}) _ = /*@MakeMap*/ (map[string]string{"": ""})
_ = /*@MakeSlice*/ (make([]int, 0)) _ = /*@MakeSlice*/ (make([]int, 0))
_ = /*@MakeClosure*/ (func() { print(param) }) _ = /*@MakeClosure*/ (func() { print(param) })