cmd/dist: add a 'gccgo && gc || gc' build constraint testcase

Given gc is set, and gccgo is not set, it should evaluate to true.
Due to a bug in the build tag implementation, it evaluates to false.

This was reported by xie cui in
https://groups.google.com/g/golang-dev/c/0k7jlbEV29o/m/3cfUZHrpCAAJ.

For #79185.

Change-Id: If34626b696c38c66d5af0d504d790bf0f197c803
Reviewed-on: https://go-review.googlesource.com/c/go/+/773821
Reviewed-by: Alan Donovan <adonovan@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
This commit is contained in:
Dmitri Shuralyov 2026-05-04 11:27:37 -04:00 committed by Gopher Robot
parent 2868672202
commit ba02236208

View file

@ -22,6 +22,7 @@ var buildParserTests = []struct {
{"gc || gccgo", true, nil},
{"gc || (gccgo && !gccgo)", true, nil},
{"gc && (gccgo || !gccgo)", true, nil},
{"gccgo && gc || gc", false, nil}, // TODO: should be true
{"!(gc && (gccgo || !gccgo))", false, nil},
{"gccgo || gc", true, nil},
{"!(!(!(gccgo || gc)))", false, nil},