Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gccgo: regression in net testcase starting with go1.9 front end #23623

Closed
laboger opened this issue Jan 30, 2018 · 3 comments
Closed

gccgo: regression in net testcase starting with go1.9 front end #23623

laboger opened this issue Jan 30, 2018 · 3 comments
Milestone

Comments

@laboger
Copy link
Contributor

laboger commented Jan 30, 2018

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go version
go version go1.9 gccgo (GCC) 8.0.0 20170914 (experimental) linux/ppc64le

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

ppc64le

What did you do?

Built gccgo on ppc64le and ran the go and libgo tests.

What did you expect to see?

No new failures.

What did you see instead?

The testcase for package net fails like this:
_testmain.go:9:20: error: incompatible type for field 2 in struct construction
{"TestAddr6", net.TestAddr6},
^
Keeping gotest118459
FAIL: net

I believe _testmain.go is generated when the tests are run and is supposed to generate a struct containing all the testcases being built for the package, but in this case it is putting TestAddr6 into the struct and that is not a function.

package main

import "./_gotest_"
import "testing"
import "testing/internal/testdeps"

var tests = []testing.InternalTest {
        {"TestSortByRFC6724", net.TestSortByRFC6724},
        {"TestAddr6", net.TestAddr6},   <--- this is not a function
        {"TestRFC6724PolicyTableClassify", net.TestRFC6724PolicyTableClassify},
        {"TestRFC6724ClassifyScope", net.TestRFC6724ClassifyScope},
        {"TestRFC6724CommonPrefixLength", net.TestRFC6724CommonPrefixLength},
        {"TestCgoLookupIP", net.TestCgoLookupIP},
        {"TestCgoLookupIPWithCancel", net.TestCgoLookupIPWithCancel},
        {"TestCgoLookupPort", net.TestCgoLookupPort},
        {"TestCgoLookupPortWithCancel", net.TestCgoLookupPortWithCancel},
        {"TestCgoLookupPTR", net.TestCgoLookupPTR},

TestAddr6 is found in dnsclient_unix_test.go:

// Test address from 2001:db8::/32 block, reserved by RFC 3849 for documentation.
var TestAddr6 = [16]byte{0x20, 0x01, 0x0d, 0xb8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}

@gopherbot gopherbot added this to the Gccgo milestone Jan 30, 2018
@laboger
Copy link
Contributor Author

laboger commented Jan 30, 2018

I should clarify: the above go version and test output was run using gcc commit 252775 to identify about where it started, but the same failure occurs on the latest trunk.

@ianlancetaylor
Copy link
Contributor

This is happening because on ppc64 the libgo/testsuite/gotest script matches on data objects. I do need to figure out a better mechanism here.

@gopherbot
Copy link

Change https://golang.org/cl/90995 mentions this issue: net: rename TestAddr6 to avoid gotest confusion

hubot pushed a commit to gcc-mirror/gcc that referenced this issue Jan 31, 2018
    
    On ppc64 gotest treats data variables whose names begin with "Test" as
    tests to run.  This is to support the function descriptors used for
    ppc64 ELF ABI v1.  This causes gotest to think that TestAddr6 is a
    test, when it is actually a variable.  For a simple fix until we can
    figure out how to write gotest properly, rename the variable.
    
    Fixes golang/go#23623
    
    Reviewed-on: https://go-review.googlesource.com/90995


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@257235 138bc75d-0d04-0410-961f-82ee72b054a4
@golang golang locked and limited conversation to collaborators Jan 31, 2019
asiekierka pushed a commit to WonderfulToolchain/gcc-ia16 that referenced this issue May 16, 2022
    
    On ppc64 gotest treats data variables whose names begin with "Test" as
    tests to run.  This is to support the function descriptors used for
    ppc64 ELF ABI v1.  This causes gotest to think that TestAddr6 is a
    test, when it is actually a variable.  For a simple fix until we can
    figure out how to write gotest properly, rename the variable.
    
    Fixes golang/go#23623
    
    Reviewed-on: https://go-review.googlesource.com/90995

From-SVN: r257235
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants