1
0
mirror of https://github.com/golang/go synced 2024-11-26 19:41:19 -07:00
go/test/fixedbugs/issue30862.dir/main.go
Matthew Dempsky bfcb7c4c8a [dev.typeparams] cmd/compile: fix unified IR support for //go:nointerface
This CL changes fixedbugs/issue30862.go into a "runindir" test so that
it can use '-goexperiment fieldtrack' and test that //go:nointerface
works with cmd/compile. In particular, this revealed that -G=3 and
unified IR did not handle it correctly.

This CL also fixes unified IR's support for //go:nointerface and adds
a test that checks that //go:nointerface, promoted methods, and
generics all interact as expected.

Updates #47045.

Change-Id: Ib8acff8ae18bf124520d00c98e8915699cba2abd
Reviewed-on: https://go-review.googlesource.com/c/go/+/332611
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
2021-07-26 18:43:12 +00:00

29 lines
549 B
Go

// Copyright 2019 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
import (
"fmt"
"os"
"issue30862.dir/b"
)
// Test case for issue 30862.
// Be aware that unless GOEXPERIMENT=fieldtrack is set when building
// the compiler, this test will fail if executed with a regular GC
// compiler.
func main() {
bad := b.Test()
if len(bad) > 0 {
for _, s := range bad {
fmt.Fprintf(os.Stderr, "test failed: %s\n", s)
}
os.Exit(1)
}
}