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

View File

@ -2,7 +2,7 @@
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)
// annotation, when passed to Function.ValueForExpr(e), returns a
// 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))
/*@UnOp*/ (<-ch)
x := /*@UnOp*/ (<-ch)
_ = x
select {
case /*@Extract*/ (<-ch):
case x := /*@Extract*/ (<-ch):
_ = x
}
defer /*@Function*/ (func() {
})()
@ -28,6 +30,7 @@ func f(param int) {
}
_ = /*@Phi*/ (y)
map1 := /*@MakeMap*/ (make(map[string]string))
_ = map1
_ = /*@MakeMap*/ (map[string]string{"": ""})
_ = /*@MakeSlice*/ (make([]int, 0))
_ = /*@MakeClosure*/ (func() { print(param) })