Skip to content

Commit 31d19c0

Browse files
committed
test: add testcase for gccgo compile failure
Also includes a small tweak to test/run.go to allow package names with Unicode letters (as opposed to just ASCII chars). Updates #27836 Change-Id: Idbf0bdea24174808cddcb69974dab820eb13e521 Reviewed-on: https://go-review.googlesource.com/138075 Reviewed-by: Cherry Zhang <[email protected]>
1 parent 019aee5 commit 31d19c0

File tree

4 files changed

+34
-1
lines changed

4 files changed

+34
-1
lines changed
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package Äfoo
2+
3+
var ÄbarV int = 101
4+
5+
func Äbar(x int) int {
6+
defer func() { ÄbarV += 3 }()
7+
return Äblix(x)
8+
}
9+
10+
func Äblix(x int) int {
11+
defer func() { ÄbarV += 9 }()
12+
return ÄbarV + x
13+
}
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package main
2+
3+
import (
4+
"fmt"
5+
6+
"./Äfoo"
7+
Äblix "./Äfoo"
8+
)
9+
10+
func main() {
11+
fmt.Printf("Äfoo.Äbar(33) returns %v\n", Äfoo.Äbar(33))
12+
fmt.Printf("Äblix.Äbar(33) returns %v\n", Äblix.Äbar(33))
13+
}

test/fixedbugs/issue27836.go

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// compiledir
2+
3+
// Copyright 2018 The Go Authors. All rights reserved.
4+
// Use of this source code is governed by a BSD-style
5+
// license that can be found in the LICENSE file.
6+
7+
package ignored

test/run.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ func goDirFiles(longdir string) (filter []os.FileInfo, err error) {
321321
return
322322
}
323323

324-
var packageRE = regexp.MustCompile(`(?m)^package (\w+)`)
324+
var packageRE = regexp.MustCompile(`(?m)^package ([\p{Lu}\p{Ll}\w]+)`)
325325

326326
// If singlefilepkgs is set, each file is considered a separate package
327327
// even if the package names are the same.

0 commit comments

Comments
 (0)