all: move //go:debug decoratemappings=0 test to cmd/go

test/decoratemappingszero.go is intended to test that
//go:debug decoratemappings=0 disables annonations.

Unfortunately, //go:debug processing is handled by cmd/go, but
cmd/internal/testdir (which runs tests from test/) generally invokes the
compiler directly, thus it does not set default GODEBUGs.

Move this test to the cmd/go script tests, alongside the similar test
for language version.

Fixes #72772.

Cq-Include-Trybots: luci.golang.try:gotip-linux-ppc64le_power10
Change-Id: I6a6a636c9d380ef984f760be5689fdc7f5cb2aeb
Reviewed-on: https://go-review.googlesource.com/c/go/+/656795
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
This commit is contained in:
Michael Pratt 2025-03-11 15:09:46 -04:00 committed by Gopher Robot
parent 8867af9207
commit 3fb8b4f3db
2 changed files with 11 additions and 7 deletions

View File

@ -1,14 +1,18 @@
// run
env GO111MODULE=on
// Copyright 2025 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.
[!GOOS:linux] skip
[short] skip
// Disable mapping annotations, which only exists for Linux.
# Programs with //go:debug decoratemappings=0 should never see annotations.
# This ensures that the runtime has not overridden the default.
go run .
//go:debug decoratemappings=0
//go:build linux
-- go.mod --
go 1.25
module m
-- main.go --
//go:debug decoratemappings=1
package main
import (