summaryrefslogtreecommitdiffstats
path: root/test/fixedbugs/issue29562.go
blob: cbcd77d5df76b062c5eda1a83e3a5c519d977831 (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
// compile

// Copyright 2019 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.

// Triggers a double walk of the (inlined) switch in il

package p

func il(s string) string {
	switch len(s) {
	case 0:
		return "zero"
	case 1:
		return "one"
	}
	return s
}

func f() {
	var s string
	var as []string
	switch false && (s+"a"+as[0]+il(s)+as[0]+s == "") {
	}
}