aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2024-08-05 11:54:51 -0700
committerGopher Robot <gobot@golang.org>2024-08-05 19:40:55 +0000
commit1f0c044d60211e435dc58844127544dd3ecb6a41 (patch)
treeee075b6976fa82fd5212464585783cde0722e638 /test
parent677e080dfed1f17de76d4914cf4935b4914e9ddb (diff)
downloadgo-1f0c044d60211e435dc58844127544dd3ecb6a41.tar.xz
test: add test that caused gofrontend to crash
Apparently people don't tend to pass untyped constant expressions to panic. For #68734 Change-Id: I6fff8137a0f001391de9e61860b67026a9db08c2 Reviewed-on: https://go-review.googlesource.com/c/go/+/603096 Reviewed-by: David Chase <drchase@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Commit-Queue: Ian Lance Taylor <iant@google.com>
Diffstat (limited to 'test')
-rw-r--r--test/fixedbugs/issue68734.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/fixedbugs/issue68734.go b/test/fixedbugs/issue68734.go
new file mode 100644
index 0000000000..e60dbc5482
--- /dev/null
+++ b/test/fixedbugs/issue68734.go
@@ -0,0 +1,17 @@
+// compile
+
+// Copyright 2024 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.
+
+// The gofrontend had a bug handling panic of an untyped constant expression.
+
+package issue68734
+
+func F1() {
+ panic(1 + 2)
+}
+
+func F2() {
+ panic("a" + "b")
+}