summaryrefslogtreecommitdiffstats
path: root/test/fixedbugs/bug465.dir/a.go
blob: 3e5d012e6a1097061c81f04ef6a12f54652c7c4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package a

type T struct{ A, B int }

type A []int

type M map[int]int

func F1() int {
	if (T{1, 2}) == (T{3, 4}) {
		return 1
	}
	return 0
}

func F2() int {
	if (M{1: 2}) == nil {
		return 1
	}
	return 0
}

func F3() int {
	if nil == (A{}) {
		return 1
	}
	return 0
}

func F4() int {
	if a := (A{}); a == nil {
		return 1
	}
	return 0
}

func F5() int {
	for k, v := range (M{1: 2}) {
		return v - k
	}
	return 0
}

func F6() int {
	switch a := (T{1, 1}); a == (T{1, 2}) {
	default:
		return 1
	}
	return 0
}

func F7() int {
	for m := (M{}); len(m) < (T{1, 2}).A; m[1] = (A{1})[0] {
		return 1
	}
	return 0
}

func F8() int {
	if a := (&T{1, 1}); a != nil {
		return 1
	}
	return 0
}

func F9() int {
	var a *T
	if a = (&T{1, 1}); a != nil {
		return 1
	}
	return 0
}