Skip to content

Commit 5d000a8

Browse files
committed
test: add test for fixed internal compiler error
Updates golang#35157 (the bug there was fixed by CL200861) Change-Id: I67069207b4cdc2ad4a475dd0bbc8555ecc5f534f Reviewed-on: https://go-review.googlesource.com/c/go/+/203598 Run-TryBot: Giovanni Bajo <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Alberto Donizetti <[email protected]>
1 parent c70e547 commit 5d000a8

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/fixedbugs/issue35157.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// compile
2+
3+
// Copyright 2019 The Go Authors. All rights reserved.
4+
// Use of this source code is governed by a BSD-style
5+
// license that can be found in the LICENSE file.
6+
7+
package p
8+
9+
func f() {
10+
var i int
11+
var b *bool
12+
var s0, s1, s2 string
13+
14+
if *b {
15+
s2 = s2[:1]
16+
i = 1
17+
}
18+
s1 = s1[i:-i+i] + s1[-i+i:i+2]
19+
s1 = s0[i:-i]
20+
}

0 commit comments

Comments
 (0)