From 415ca3f1f0fa05a98561752e0787f59b77f19645 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 10 Mar 2021 19:35:22 -0800 Subject: [PATCH] test: add test that caused a gofrontend internal error For #44383 Change-Id: I3610105dad3574e210e226d3ba80a4ba5a7eeaa6 Reviewed-on: https://go-review.googlesource.com/c/go/+/300789 Trust: Ian Lance Taylor Run-TryBot: Ian Lance Taylor TryBot-Result: Go Bot Reviewed-by: Brad Fitzpatrick Reviewed-by: Than McIntosh Reviewed-by: Cherry Zhang --- test/fixedbugs/issue44383.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 test/fixedbugs/issue44383.go diff --git a/test/fixedbugs/issue44383.go b/test/fixedbugs/issue44383.go new file mode 100644 index 00000000000..d2d57524d16 --- /dev/null +++ b/test/fixedbugs/issue44383.go @@ -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() +}