summaryrefslogtreecommitdiff
path: root/libgo/testsuite
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2020-11-16 20:06:53 -0800
committerIan Lance Taylor <iant@golang.org>2020-11-20 12:44:35 -0800
commita01dda3c23b836754814fab1cab949a1bbc641e8 (patch)
tree826310b88323c0f636baf89393557fde6a56fdeb /libgo/testsuite
parent90bf60c3c24c6c99ebbecf9d08a6d0d916d73721 (diff)
compiler, libgo: change mangling scheme
Overhaul the mangling scheme to avoid ambiguities if the package path contains a dot. Instead of using dot both to separate components and to mangle characters, use dot only to separate components and use underscore to mangle characters. For golang/go#41862 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/271726
Diffstat (limited to 'libgo/testsuite')
-rwxr-xr-xlibgo/testsuite/gotest7
1 files changed, 4 insertions, 3 deletions
diff --git a/libgo/testsuite/gotest b/libgo/testsuite/gotest
index 0fd64194360..8c3c5ca1b32 100755
--- a/libgo/testsuite/gotest
+++ b/libgo/testsuite/gotest
@@ -496,7 +496,8 @@ testname() {
localname() {
# The package main has been renamed to __main__ when imported.
# Adjust its uses.
- echo $1 | sed 's/^main\./__main__./'
+ # Also demangle underscores.
+ echo $1 | sed 's/^main\./__main__./' | sed 's/__/_/'
}
# Takes a list of tests derived from 'nm' output (whose symbols are mangled)
@@ -504,7 +505,7 @@ localname() {
# Example:
#
# Original symbol: foo/bar/leaf.Mumble
-# Mangled symbol: foo..z2fbar..z2fleaf.Mumble
+# Mangled symbol: foo_1fbar_1leaf.Mumble
# Returned: leaf.Mumble
#
symtogo() {
@@ -522,7 +523,7 @@ symtogo() {
if expr "$tp" : '^type\.\.' >/dev/null 2>&1; then
continue
fi
- s=$(echo "$tp" | sed -e 's/\.\.z2f/%/g' | sed -e 's/.*%//')
+ s=$(echo "$tp" | sed -e 's/_1/%/g' | sed -e 's/.*%//')
# Screen out methods (X.Y.Z).
if ! expr "$s" : '^[^.]*\.[^.]*$' >/dev/null 2>&1; then
continue