Skip to content

Commit e8c7e63

Browse files
committed
test: new testcase for gccgo compiler failure
Updates #33219 Change-Id: I1702d4c630bb891fcb8b59e775dd3f1673cd8640 Reviewed-on: https://go-review.googlesource.com/c/go/+/187057 Run-TryBot: Than McIntosh <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent 707f3e8 commit e8c7e63

File tree

4 files changed

+71
-0
lines changed

4 files changed

+71
-0
lines changed

test/fixedbugs/issue33219.dir/a.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright 2019 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 A interface {
8+
M(i interface{}) interface{}
9+
}
10+
11+
var a1 A
12+
var a2 A
13+
14+
func V(p A, k, v interface{}) A {
15+
defer func() { a1, a2 = a2, a1 }()
16+
return a1
17+
}

test/fixedbugs/issue33219.dir/b.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Copyright 2019 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 b
6+
7+
import "./a"
8+
9+
type Service uint64
10+
11+
var q *Service
12+
var r *Service
13+
14+
type f struct{}
15+
16+
var fk f
17+
18+
func No(s a.A, qq uint8) *Service {
19+
defer func() { q, r = r, q }()
20+
return q
21+
}
22+
23+
func Yes(s a.A, p *uint64) a.A {
24+
return a.V(s, fk, p)
25+
}

test/fixedbugs/issue33219.dir/c.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright 2019 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 c
6+
7+
import (
8+
"a"
9+
"b"
10+
)
11+
12+
type BI interface {
13+
Another(pxp a.A) int32
14+
}
15+
16+
//go:noinline
17+
func BRS(sd a.A, xyz int) *b.Service {
18+
x := b.Yes(sd, nil)
19+
return b.No(x, 1)
20+
}

test/fixedbugs/issue33219.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// compiledir
2+
3+
// Copyright 2019 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+
// Issue 33219: gccgo assert in "implements_interface()"
8+
9+
package ignored

0 commit comments

Comments
 (0)