From 2695d311b910e357ea1a347b221676a6906850bd Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Wed, 18 Sep 2013 11:39:55 -0700 Subject: [PATCH] go.tools/ssa: fix ssa tests (fix build partly) R=adonovan CC=golang-dev https://golang.org/cl/13668048 --- ssa/testdata/objlookup.go | 5 ++++- ssa/testdata/valueforexpr.go | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ssa/testdata/objlookup.go b/ssa/testdata/objlookup.go index 9e59f61c..249e9947 100644 --- a/ssa/testdata/objlookup.go +++ b/ssa/testdata/objlookup.go @@ -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. diff --git a/ssa/testdata/valueforexpr.go b/ssa/testdata/valueforexpr.go index bd7bcd66..140447ef 100644 --- a/ssa/testdata/valueforexpr.go +++ b/ssa/testdata/valueforexpr.go @@ -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) })