Skip to content

Commit 8ccafb1

Browse files
test: add fixedbugs/bug506 for gccgo
Building with gccgo failed with an undefined symbol error from an unnecessary hash function. Updates #19773 Change-Id: Ic78bf1b086ff5ee26d464089c0e14987d3fe8b02 Reviewed-on: https://go-review.googlesource.com/c/130956 Run-TryBot: Ian Lance Taylor <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]>
1 parent e0a97a5 commit 8ccafb1

File tree

3 files changed

+46
-0
lines changed

3 files changed

+46
-0
lines changed

test/fixedbugs/bug506.dir/a.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright 2018 The Go Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
5+
package a
6+
7+
type internal struct {
8+
f1 string
9+
f2 float64
10+
}
11+
12+
type S struct {
13+
F struct {
14+
I internal
15+
}
16+
}

test/fixedbugs/bug506.dir/main.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright 2018 The Go Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
5+
package main
6+
7+
import (
8+
"fmt"
9+
10+
"./a"
11+
)
12+
13+
var v = a.S{}
14+
15+
func main() {
16+
want := "{{ 0}}"
17+
if got := fmt.Sprint(v.F); got != want {
18+
panic(got)
19+
}
20+
}

test/fixedbugs/bug506.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// rundir
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+
// Gccgo caused an undefined symbol reference building hash functions
8+
// for an imported struct with unexported fields.
9+
10+
package ignored

0 commit comments

Comments
 (0)