summaryrefslogtreecommitdiffstats
path: root/src/cmd/cgo/internal/testplugin
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-08 04:11:07 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-08 04:11:07 +0000
commit17cd1672e40d83687d20266b4f71a0dce064f0e4 (patch)
tree1e10132d08269d9fba82dbba3c5b991e070d3446 /src/cmd/cgo/internal/testplugin
parentReleasing progress-linux version 1.22.3-1~progress7.99u1. (diff)
downloadgolang-1.22-17cd1672e40d83687d20266b4f71a0dce064f0e4.tar.xz
golang-1.22-17cd1672e40d83687d20266b4f71a0dce064f0e4.zip
Merging upstream version 1.22.4.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/cmd/cgo/internal/testplugin')
-rw-r--r--src/cmd/cgo/internal/testplugin/plugin_test.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/cmd/cgo/internal/testplugin/plugin_test.go b/src/cmd/cgo/internal/testplugin/plugin_test.go
index 1e32ff8..4900ada 100644
--- a/src/cmd/cgo/internal/testplugin/plugin_test.go
+++ b/src/cmd/cgo/internal/testplugin/plugin_test.go
@@ -74,6 +74,7 @@ func testMain(m *testing.M) int {
}
defer os.RemoveAll(GOPATH)
tmpDir = GOPATH
+ fmt.Printf("TMPDIR=%s\n", tmpDir)
modRoot := filepath.Join(GOPATH, "src", "testplugin")
altRoot := filepath.Join(GOPATH, "alt", "src", "testplugin")
@@ -395,3 +396,21 @@ func TestIssue62430(t *testing.T) {
goCmd(t, "build", "-o", "issue62430.exe", "./issue62430/main.go")
run(t, "./issue62430.exe")
}
+
+func TestTextSectionSplit(t *testing.T) {
+ globalSkip(t)
+ if runtime.GOOS != "darwin" || runtime.GOARCH != "arm64" {
+ t.Skipf("text section splitting is not done in %s/%s", runtime.GOOS, runtime.GOARCH)
+ }
+
+ // Use -ldflags=-debugtextsize=262144 to let the linker split text section
+ // at a smaller size threshold, so it actually splits for the test binary.
+ goCmd(nil, "build", "-ldflags=-debugtextsize=262144", "-o", "host-split.exe", "./host")
+ run(t, "./host-split.exe")
+
+ // Check that we did split text sections.
+ syms := goCmd(nil, "tool", "nm", "host-split.exe")
+ if !strings.Contains(syms, "runtime.text.1") {
+ t.Errorf("runtime.text.1 not found, text section not split?")
+ }
+}