aboutsummaryrefslogtreecommitdiff
path: root/test/fixedbugs/issue52438.go
diff options
context:
space:
mode:
authorChressie Himpel <chressie@google.com>2022-04-27 20:09:28 +0200
committerChressie Himpel <chressie@google.com>2022-04-27 20:09:28 +0200
commitec7f5165ddc680efbac18dc15b4905844d9e8db9 (patch)
treeeacc43345e3d6f0adfda16bfcf66e7e5096a85b9 /test/fixedbugs/issue52438.go
parentca6fd39cf6498d4507fc7cdaced55620c283a503 (diff)
parentf0ee7fda636408b4f04ca3f3b11788f662c90610 (diff)
downloadgo-ec7f5165ddc680efbac18dc15b4905844d9e8db9.tar.gz
go-ec7f5165ddc680efbac18dc15b4905844d9e8db9.zip
[dev.boringcrypto] all: merge master into dev.boringcrypto
Change-Id: Ic5f71c04f08c03319c043f35be501875adb0a3b0
Diffstat (limited to 'test/fixedbugs/issue52438.go')
-rw-r--r--test/fixedbugs/issue52438.go39
1 files changed, 39 insertions, 0 deletions
diff --git a/test/fixedbugs/issue52438.go b/test/fixedbugs/issue52438.go
new file mode 100644
index 00000000000..375e727ee30
--- /dev/null
+++ b/test/fixedbugs/issue52438.go
@@ -0,0 +1,39 @@
+// run
+
+// Copyright 2022 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.
+
+package main
+
+const c1 = iota
+const c2 = iota
+
+const c3 = 0 + iota<<8
+const c4 = 1 + iota<<8
+
+func main() {
+ if c1 != 0 {
+ panic(c1)
+ }
+ if c2 != 0 {
+ panic(c2)
+ }
+
+ if c3 != 0 {
+ panic(c3)
+ }
+ if c4 != 1 {
+ panic(c4)
+ }
+
+ const c5 = iota
+ const c6 = iota
+
+ if c5 != 0 {
+ panic(c5)
+ }
+ if c6 != 0 {
+ panic(c6)
+ }
+}