-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgccgo_tree
41 lines (37 loc) · 1.78 KB
/
gccgo_tree
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env bash
set -e
# Copy all std packages to "gccgo" folder under src.
# So, "regexp" becomes "gccgo/regexp".
mkdir -p gccgo
cp -a src/* gccgo/
mv gccgo src
# Move go1 bench suite to src for convenience.
mkdir -p src/bench/
mkdir -p src/gccgo/bench/
cp -a test/bench/go1 src/bench/go1
cp -a src/bench/go1 src/gccgo/bench/go1
# Patch gccgo tree to avoid compilation errors and other issues
# during benchmark execution.
#
# No benchmarks and/or uses dot import:
rm src/gccgo/bufio/scan_test.go
rm src/gccgo/context/x_test.go
rm src/gccgo/time/zoneinfo_test.go
rm src/gccgo/time/format_test.go
rm src/gccgo/runtime/crash_unix_test.go
# Have benchmarks and uses dot import:
sed -i 's/\. "strings"/\. "gccgo\/strings"/g' src/gccgo/strings/strings_test.go
sed -i 's/\. "strings"/\. "gccgo\/strings"/g' src/gccgo/strings/search_test.go
sed -i 's/\. "strings"/\. "gccgo\/strings"/g' src/gccgo/strings/replace_test.go
sed -i 's/\. "reflect"/\. "gccgo\/reflect"/g' src/gccgo/reflect/all_test.go
sed -i 's/\. "reflect"/\. "gccgo\/reflect"/g' src/gccgo/reflect/tostring_test.go
sed -i 's/\. "fmt"/\. "gccgo\/fmt"/g' \src/gccgo/fmt/fmt_test.go
sed -i 's/\. "math"/\. "gccgo\/math"/g' src/gccgo/math/all_test.go
sed -i 's/\. "sort"/\. "gccgo\/sort"/g' src/gccgo/sort/sort_test.go
sed -i 's/\. "strconv"/\. "gccgo\/strconv"/g' src/gccgo/strconv/decimal_test.go
sed -i 's/\. "strconv"/\. "gccgo\/strconv"/g' src/gccgo/strconv/atof_test.go
sed -i 's/\. "strconv"/\. "gccgo\/strconv"/g' src/gccgo/strconv/ftoa_test.go
sed -i 's/\. "unicode\/utf16"/\. "gccgo\/unicode\/utf16"/g' src/gccgo/unicode/utf16/utf16_test.go
# Patch C sources (change symbols):
sed -i 's/"strings\.IndexByte"/"gccgo_strings\.IndexByte"/g' src/gccgo/strings/indexbyte.c
sed -ri 's/"bytes\.([a-zA-Z]+)"/"gccgo_bytes\.\1"/g' src/gccgo/bytes/indexbyte.c