3 // Tests of 'freevars' query.
4 // See go.tools/guru/guru_test.go for explanation.
5 // See freevars.golden for expected query results.
7 // TODO(adonovan): it's hard to test this query in a single line of gofmt'd code.
24 if y := 2; x+y+int(C(3)) != exp { // @freevars fv1 "if.*{"
30 for x, y := range "foo" {
31 println(s.x + s.t.a + s.t.b + x + int(y)) // @freevars fv2 "print.*y."
34 f(x) // @freevars fv3 "f.x."
36 loop: // @freevars fv-def-label "loop:"
38 break loop // @freevars fv-ref-label "break loop"