]> Cypherpunks repositories - gostls13.git/commitdiff
test: add test that caused a gofrontend internal error
authorIan Lance Taylor <iant@golang.org>
Thu, 11 Mar 2021 03:35:22 +0000 (19:35 -0800)
committerIan Lance Taylor <iant@golang.org>
Thu, 11 Mar 2021 17:20:58 +0000 (17:20 +0000)
For #44383

Change-Id: I3610105dad3574e210e226d3ba80a4ba5a7eeaa6
Reviewed-on: https://go-review.googlesource.com/c/go/+/300789
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
test/fixedbugs/issue44383.go [new file with mode: 0644]

diff --git a/test/fixedbugs/issue44383.go b/test/fixedbugs/issue44383.go
new file mode 100644 (file)
index 0000000..d2d5752
--- /dev/null
@@ -0,0 +1,18 @@
+// compile
+
+// Copyright 2021 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.
+
+// Issue 44383: gofrontend internal compiler error
+
+package main
+
+func main() {
+       var b1, b2 byte
+       f := func() int {
+               var m map[byte]int
+               return m[b1/b2]
+       }
+       f()
+}