diff --git a/src/cmd/compile/internal/syntax/testdata/issue70974.go b/src/cmd/compile/internal/syntax/testdata/issue70974.go new file mode 100644 index 00000000000000..ebc69eda950254 --- /dev/null +++ b/src/cmd/compile/internal/syntax/testdata/issue70974.go @@ -0,0 +1,17 @@ +// Copyright 2025 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 p + +func _() { +M: +L: + for range 0 { + break L + break /* ERROR invalid break label M */ M + } + for range 0 { + break /* ERROR invalid break label L */ L + } +}