mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[dev.typeparams] all: merge master (9b84814) into dev.typeparams
Merge List: + 2021-05-119b84814f6enet/http: check that Unicode-aware functions are not used + 2021-05-112520e72d3bruntime: hold sched.lock across atomic pidleget/pidleput + 2021-05-11326a792517runtime,syscall: simplify openbsd related build tags + 2021-05-105c489514bcnet/http: switch HTTP1 to ASCII equivalents of string functions + 2021-05-10dc50683bf7crypto/elliptic: upgrade from generic curve impl to specific if available + 2021-05-1073d5aef4d1cmd/internal/objfile: add objabi.SNOPTRDATA to "D" + 2021-05-10d9e068d289runtime/cgo,cmd/internal/obj/ppc64: fix signals with cgo + 2021-05-10deb3403ff5go/build: include files with parse errors in GoFiles and other lists + 2021-05-1082517acae8net, runtime: drop macOS 10.12 skip conditions in tests + 2021-05-10031854117fcmd/go: include packages with InvalidGoFiles when filtering main packages + 2021-05-10a9edda3788cmd/go: add a test that reproduces #45827 + 2021-05-10e18a8b4fb2go/build: avoid duplicates in InvalidGoFiles + 2021-05-10287025925fcmd/compile,reflect: allow longer type names + 2021-05-09c14ecaca81runtime: skip TestCrashDumpsAllThreads on openbsd/arm + 2021-05-09bedf2c4886runtime,syscall: convert syscall on openbsd/arm to libc + 2021-05-09603f43cbaeruntime: switch runtime to libc for openbsd/arm + 2021-05-0983df4a590bruntime: switch openbsd/arm locking to libc + 2021-05-098ec8f6aa87runtime: switch openbsd/arm to pthreads + 2021-05-095203357ebacmd/compile: make non-concurrent compiles deterministic again + 2021-05-09ea93e68858crypto/elliptic: make P-521 scalar multiplication constant time + 2021-05-0914c3d2aa59crypto/elliptic: import fiat-crypto P-521 field implementation + 2021-05-09ec4efa4208crypto/x509: check the private key passed to CreateCertificate + 2021-05-08b38b1b2f9acmd/compile: manage Slot array better + 2021-05-0868327e1aa1cmd/vendor: upgrade pprof to latest + 2021-05-084c8f48ed4fsyscall: do not change stdio handle inheritance + 2021-05-089d0819b27ccrypto/tls: make cipher suite preference ordering automatic + 2021-05-0802ce411821crypto/x509: remove GODEBUG=x509ignoreCN=0 flag + 2021-05-08b211fe0058cmd/compile: remove bit operations that modify memory directly + 2021-05-07f24eac4771cmd/compile: improving the documentation of various fields and functions + 2021-05-073980c4db19doc/go1.17: fill in TODO for compress/lzw package + 2021-05-07d80d1427a8doc/go1.17: fill in TODO for reflect package + 2021-05-07af6123a865doc/go1.17: document encoding/binary.Uvarint max read of 10 bytes + 2021-05-07b44c78b8c3doc/go1.17: fill in TODO for strconv package + 2021-05-079bfa6f75d5cmd/internal/obj: consolidate MOVB cases with other MOV ops on ppc64 + 2021-05-07a0eb662d85doc/go1.17: move language specification TODO to the right place + 2021-05-07bdb8044665cmd/link: don't include arginfo symbols in symbol table + 2021-05-07f5423ea615cmd/compile/internal/types2: add test case for issue 45985 + 2021-05-07832c70e33dinternal/poll: cast off the last reference of SplicePipe in test + 2021-05-07d2b03111c4go/types,cmd/compile/internal/types2: unskip std and cmd in TestStdlib + 2021-05-079524e93adfgo/types: add a test case for issue 45985 + 2021-05-07a11a1711b0go/types: expose types.Info.Inferred with -tags=typeparams + 2021-05-064dbad79510runtime: call unlockOSThread directly in Windows syscall functions + 2021-05-06f39997b2becmd/link: split large text sections on Darwin/ARM64 when external linking + 2021-05-0690d6bbbe42crypto/tls: enforce ALPN overlap when negotiated on both sides + 2021-05-06402f177efccmd/compile: fix intrinsic setting for mul64, add64 on ppc64le + 2021-05-0651ff3a6965crypto/x509: rewrite certificate parser + 2021-05-065f9fe47deaCONTRIBUTORS: change my name + 2021-05-066c591f79b0math/big: check for excessive exponents in Rat.SetString + 2021-05-0654e20b505ddoc/go1.17: document fixes for negative rune handling + 2021-05-06d2fd503f68text/template: fix type bug in eq + 2021-05-060e7a7a68cdtext/template/parse: rename DeferFuncCheck to SkipFuncCheck + 2021-05-06ba0f8ce50fruntime: gofmt proc_test.go + 2021-05-06b4ca1cec69cmd/compile: set unsayable "names" for regabi testing triggers + 2021-05-061108cbe60bcrypto/ecdsa,crypto/elliptic: improve tests and benchmarks + 2021-05-0643c390a1facrypto/ed25519: skip allocations test on -noopt builder + 2021-05-05cf73f1a8e4go/parser: don't parse a nil IndexExpr.Index + 2021-05-0515557af207doc/go1.17: fill in Go 1.17 release note TODOs using relnote + 2021-05-05b0c49ae9f5crypto/ed25519: replace internal/edwards25519 with filippo.io/edwards25519 + 2021-05-05543e098320go/types: fix potential bugs in santitizer pass + 2021-05-0540d5e6d4e2cmd/compile/internal/types2: fix potential bugs in santitizer pass + 2021-05-05784ef4c531net/http: ignore directory path when parsing multipart forms + 2021-05-0595dde3f029cmd/compile: do not substitute OGOTO inside a closure when inlining + 2021-05-05d0583b131acmd/go: spot-check the explicit requirements of root module dependencies when loading packages from them + 2021-05-0518e666bad7cmd/go: skip TestExecInDeletedDir on aix and solaris-based platforms + 2021-05-0569368cece5cmd/compile/internal/types2: make TestManual work for directories + 2021-05-053b304ce7feruntime: implement runqdrain() for GC mark worker goroutines + 2021-05-05f34fe8e370all: update vendored dependencies for Go 1.17 + 2021-05-054c9791299druntime: remove redundant save_g call in mcall for arm + 2021-05-059e0facd26ecmd/compile/internal/types2: implement types2.Instantiate + 2021-05-05caf4c9434bcmd/compile: debug trace output for -N variable location gen + 2021-05-0566ce8aa88dcmd/compile: handle degenerate entry blocks in -N debug gen + 2021-05-054df662fb37cmd/go: don't crash when running "go version" in deleted directory + 2021-05-05bb5e45219acmd/go.sum: remove untidy checksums + 2021-05-04137be7712fembed/internal/embedtest: add test for embedded path starting with dash + 2021-05-04cb0658e624go/types: expose more API under -tags=typeparams + 2021-05-0462a87f64b9cmd/go/internal/modload: only check root-promotion during tidy for lazy modules + 2021-05-046a6aa32783cmd/go: add a test that reproduces the internal error in #45952 + 2021-05-04cd28ca3a4eruntime: abort when receiving a signal on a non-Go thread on Windows + 2021-05-04d19e5493bddoc/go1.17: require macOS 10.13 or later + 2021-05-0410a082aa70cmd/go: update x/mod to fix "//indirect" comment editing + 2021-05-04f62739b861cmd/compile: establish regabi name/value mapping for small in-params + 2021-05-048c3d217d89os: skip TestExecutableDeleted on plan9 + 2021-05-04e15d1f4e64internal/buildcfg: set Error instead of panicking + 2021-05-04da7496d841os/signal: increase test timeouts on ppc64*/linux + 2021-05-04d83baa1aa2cmd/dist,cmd/go: set GOTRACEBACK to "system" for testing + 2021-05-0410d625d5b4database/sql: add NullInt16 and NullByte + 2021-05-04371ea545c0net/url: avoid string concatenation in resolvePath + 2021-05-0462d424d794cmd: update x/tools to pull in CL 315570 + 2021-05-04eab0c46af7cmd/go/internal/modload: remove outdated comments and redundant tests + 2021-05-040816511d3ball: update x/crypto to pull in CL 316109 + 2021-05-048e38b80b64cmd: update x/text to pull in CL 315571 + 2021-05-041bbe78bb6dcmd: update x/mod to pull in CL 316113 + 2021-05-0486e42c2fbfcmd/go: suppress SSH password prompts when fetching modules or repos + 2021-05-045e4f9b077fcmd/compile: when compiling with -N, avoid entry block + 2021-05-040921211403cmd/compile: preserve/translate names for parameters + 2021-05-04830e63a7a3syscall: add //go:build lines to assembly files + 2021-05-0445600bcd61os, syscall: use wait6 to avoid wait/kill race on netbsd + 2021-05-04138d2c9b88strconv: fix a typo + 2021-05-04e3769299cdstrconv: add QuotedPrefix + 2021-05-042422c5eae5sync/atomic: add (*Value).Swap and (*Value).CompareAndSwap + 2021-05-04496d7c6914text/template: add lock for Template.tmpl to fix data race + 2021-05-03731a015ab8internal/syscall/unix: use internal/abi.FuncPC for syscall wrapper + 2021-05-03e8eb1d8269math: add MaxUint, MinInt, MaxInt + 2021-05-03ed5ebd32b3os: update some docs to reference fs.ErrFoo instead of os.ErrFoo + 2021-05-03ddb648fdf6archive/zip: add File.OpenRaw, Writer.CreateRaw, Writer.Copy + 2021-05-039f347035efcmd/api: disallow silent API additions after api/go1.n.txt is created + 2021-05-03791854700dall: update x/net to pull in CL 316129 + 2021-05-03a144af9136cmd: update x/term to pull in CL 316112 + 2021-05-038a4b7294afcmd/compile: fix possible nil deref added in CL 270943 + 2021-05-037f9febd4a1cmd/compile: fix linux-amd64-noopt builder + 2021-05-0390ec257735cmd/compile: make the stack allocator more careful about register args. + 2021-05-03b584230889net/http: use relative path in Location redirect + 2021-05-03169155d61ecmd/compile: preserve argument order in debug_info + 2021-05-03472f519fe2cmd/compile/internal/ssagen: fix misleading comment + 2021-05-03d75fbac54dcmd/compile: add edge from lock rank edge from forceGC to traceStackTab + 2021-05-037b768d43d0math: replace float32/64 extrema with exact expressions + 2021-05-03be1da9cdeecmd/link: unify text segment write + 2021-05-038327d2150fcmd/compile: add traceback argument info to ABI0 assembly functions + 2021-05-03844e1fc6f1cmd/compile: make typecheckaste correctly report invalid use of "..." + 2021-05-039ed736ac2acmd/link/internal: fix use of DynlinkingGo with ppc64le trampolines + 2021-05-0330674ae91bcmd/dist: disable misc/cgo/testsanitizers on ppc64le + 2021-05-032c9f5a1da8cmd: update x/arch to pull in CL 315572 + 2021-05-02abb110bf3dos/user: implement (*User).GroupIds on solaris + 2021-05-02b177b2d51eos, syscall: use wait6 to avoid wait/kill race on dragonfly + 2021-05-027eb2d30883syscall: add //go:build lines to files generated with with mksyscall_libc.pl + 2021-05-02bb09f8a29btime: make time.Time print a valid Go string with %#v + 2021-05-02fadad851a3cmd/compile: implement unsafe.Add and unsafe.Slice + 2021-05-020d32d9e8a8os: document that Windows Symlink to missing target creates file symlink + 2021-05-02352a322a83path/filepath: fix documentation typo (was "each each") + 2021-05-01053fe2f485cmd/link: emit better error for duplicated definition + 2021-05-01d7473fd907cmd/link: mangle ABI name for shared linkage + 2021-05-01879db69ce2go/types: list errors by default in TestManual + 2021-05-01a9db5a7386go/types: simplify use of TestManual + 2021-05-01ffc38d8ab4go/types: slice-to-array-pointer conversion requires go1.17 + 2021-04-308e91458b19runtime,syscall: convert syscall on openbsd/386 to libc + 2021-04-30faff49aae6runtime: switch runtime to libc for openbsd/386 + 2021-04-300bbfc5c31eruntime: break up large calls to memclrNoHeapPointers to allow preemption + 2021-04-3041afd3af42cmd/compile: fix abbrev selection for output params + 2021-04-30d19eece91fcmd/compile: handle field padding for register-passed structs + 2021-04-30162d4f9c92cmd/compile: regabi support for DWARF location expressions + 2021-04-3093200b98c7bufio: mention ErrFinalToken in SplitFunc documentation + 2021-04-30c23a32284aruntime: work around vet asmdecl checks for openbsd/386 mstart_stub + 2021-04-30afa58ddf5acmd/compile: revise block/func end sentinels in debug analysis + 2021-04-3083ac59b1a5cmd/internal/archive: make error message contain printable characters only + 2021-04-30c3b2b04156runtime: switch openbsd/386 locking to libc + 2021-04-304893eee9dcruntime: switch openbsd/386 to pthreads + 2021-04-30d9bfda8124cmd/go: remove the special case for "unsafe" in importFromModules + 2021-04-30cbff713e68cmd/go: add GODEBUG tokens for debugging lazy module loading + 2021-04-30eb71887b99cmd/go: prune go.mod and go.sum files from vendored dependencies + 2021-04-30c3365ad5f2cmd/go: annotate versions in vendor/modules.txt + 2021-04-307dedc237c5cmd/go: smooth out upgrade paths for lazy loading + 2021-04-300e315ad79acmd/go/internal/modload: avoid loading the full module graph when listing specific modules + 2021-04-30c05d50f8f3cmd/go/internal/modload: avoid loading the module graph to list only the name of the main module + 2021-04-30ee4f9656accmd/go/internal/modload: avoid loading the full module graph to determine which checksums to add to go.sum + 2021-04-304063605e0dcmd/go/internal/modload: avoid loading the full module graph for imports satisfied by lazy roots + 2021-04-308d8abb3b8acmd/go: verify lazy-loading invariants when loading the vendor list for a lazy module + 2021-04-309a81702b97cmd/go: enable lazy loading + 2021-04-302bd3e48055cmd/go/internal/modload: implement lazy loading + 2021-04-309c12f1b433internal/buildcfg: enable regabi for Android + 2021-04-3095c5f4da80cmd/compile/internal/types2: list errors by default in TestManual + 2021-04-30c55d5c887ecmd/compile/internal/types2: simplify use of TestManual + 2021-04-3089bf297b24cmd/internal/objfile: emit better error for Go object of a different version + 2021-04-30a893682d83net/url: add Values.Has + 2021-04-303366556d1cA+C: add Weixie Cui (individual CLA) + 2021-04-30cc02d59e84cmd/gofmt: always format non-directory arguments again + 2021-04-300dfb6fb490go/ast: print CommentMap contents in source order + 2021-04-3006ac303f6acmd/internal/obj/ppc64: simplify got/toc address classification + 2021-04-309c7207891ccmd/internal/obj/arm64: fix the size of STP series instructions in optab + 2021-04-30303b194c6dapi: update next.txt + 2021-04-303498027329math: increase precision of math.SmallestNonzeroFloat64 + 2021-04-3002ab8d1a1dcmd/compile, runtime: emit only GC data for stack objects + 2021-04-29a9705e157bcmd/compile/internal/types2: slice-to-array-pointer conversion requires go1.17 + 2021-04-29e99dfb0e5ccmd/compile: make GC prog symbol content-addressable + 2021-04-291df309eb02cmd/compile: skip types.Sym for GC mask symbols + 2021-04-29897baae953runtime/metrics: add additional allocation metrics + 2021-04-29fd09593667cmd/compile: minor doc enhancements + 2021-04-297b32830f58crypto/elliptic: store P-256 precomputed basepoint table in source + 2021-04-2987e4dcd446archive/zip: only return directory once via io/fs.FS + 2021-04-296d95e5a4ffencoding/csv: add FieldPos method + 2021-04-292c05ba4ae0runtime: top align tinyallocs in race mode + 2021-04-2932dbaac572cmd/compile/internal/walk: merge operations when calling ir.NewSlic… + 2021-04-29e03cca6407runtime: use 4 MiB heap arenas on iOS + 2021-04-295a8435d701go/types: add additional test data from types2 + 2021-04-29f7c6f6210bcmd/link: test trampolines with cgo + 2021-04-29948a262455cmd/compile/internal/types2: nest all test data under the testdata directory + 2021-04-2912eaefead4cmd/link: support trampoline insertion for PLT calls on ARM + 2021-04-29657f58d845cmd/link: support trampoline insertion for PLT calls on ARM64 + 2021-04-29f12dfeac89cmd/link: support trampoline insertion on ARM64 + 2021-04-29b15372f39bruntime: remove linux-amd64 walltime function + 2021-04-29862ddb37b4runtime: rename walltime1 to walltime + 2021-04-294e3e6b58f7cmd/compile/internal/ir: fix doc + 2021-04-2918852e8372cmd/link: use a two-pass approach for trampoline insertion + 2021-04-29d80da19fc9cmd/link: update comment for PLT/GOT helper functions + 2021-04-29eb3fe28d70go/types: improve error messages for unexpected ListExprs + 2021-04-29c8a92d454cgo/types: ensure that error code values do not change in 1.17 + 2021-04-2947cb0c46b2go/types: nest all test data under the testdata directory + 2021-04-29c4c68fb57fcmd/compile/internal/walk: delete unused statement + 2021-04-296afa0ae4e5cmd/compile/internal/types2: match compiler error for invalid type alias decl + 2021-04-2942953bc9f5runtime: remove walltime function + 2021-04-29d09947522druntime: implement time.now in assembly for linux-amd64 + 2021-04-29756fd56bbfcmd/compile: remove an unused function + 2021-04-28fa6ed6e81ago/types: respect IgnoreFuncBodies for function literals + 2021-04-286082c05d8bgo/types: better errors for invalid short var decls + 2021-04-28414af503d7go/types: fix type inference + 2021-04-28c96fec9036runtime: use a single definition of time_now for faketime + 2021-04-28b36596b14fruntime: move Windows time.now implementations into separate files + 2021-04-2807e006dd93go/types: use a global atomic counter for type parameter ids + 2021-04-28168dd4e6aago/types: add example test for type inference + 2021-04-281e235cd454go/types: use combined type and ordinary args for type inference + 2021-04-28ad989c7dbacrypto/cipher: make AES-GCM benchmarks match ChaCha20Poly1305 ones + 2021-04-28764f53eb6cspec: clarify conditions for switch expression type + 2021-04-2842812a2feetypes2: disambiguate package qualifiers in error messages + 2021-04-28ea65a12f89cmd/compile/internal/types2: catch unexpected expression lists + 2021-04-2890614ff462cmd/go/internal/modfetch: fix comment that mentions no-longer returned error + 2021-04-28a54762586fcmd/gofmt: simplify arg handling + 2021-04-2822a56b629dcmd/go/internal/modload: in importFromModules, do not wrap module graph errors in ImportMissingError + 2021-04-28f893f35d9fgo/types: split out function instantiation from index expr + 2021-04-285b328c4a2fcmd/compile: use desired register only if it satisfies register mask + 2021-04-28cbb3f09047testing: add -shuffle=off|on|N to alter the execution order of tests and benchmarks + 2021-04-28e51246c881runtime: consolidate Windows time constants into single copy + 2021-04-2892c9f3a9b8cmd/go: include C/C++/Fortran compiler version in build ID + 2021-04-28becb9a278ftest: do not run fuse test in noopt mode + 2021-04-2824ea547a21cmd/link: don't pass -Wl,--dynamic-linker if -static + 2021-04-2812af403624cmd/go/internal/bug: use envcmd instead of go env + 2021-04-285c69cb2a5bcmd/go: populate module info even if an error occurs in loading package + 2021-04-2811052d77a3cmd/link: use R12 as trampoline scratch register on ARM + 2021-04-284a7effa418cmd/compile: mark R12 clobbered for special calls + 2021-04-284fe324dd0fcmd/go: make TOOLEXEC_IMPORTPATH consistent with 'go list -f {{.ImportPath}}' + 2021-04-28f68878f0fccmd/dist,runtime: support cgo on openbsd/mips64 + 2021-04-2892d1afe989cmd/compile/ssa: optimize the derivable known branch of If block + 2021-04-289726c78539cmd/asm: add check for register and shift/extension combination on arm64 + 2021-04-28f439a76253cmd/internal/obj/arm64: fix the wrong error message of out-of-range checking + 2021-04-28c9f43507c6cmd/compile: fix typechecking logical operators panic with non-boolean operand + 2021-04-27983dea90c1cmd/link: disable plugin support if cgo is disabled + 2021-04-27214c8dd80cgo/types: factor out index/slice expr handling + 2021-04-27645cb62ee3testing: document that TestMain can be used with benchmarks + 2021-04-2730002e6656cmd/go/internal/modload: treat \ as a path separator instead of a shell special character + 2021-04-27b9dfaf77f5cmd/compile/internal/walk: merge operations + 2021-04-2713e87cda00time: increase slop for TestTicker + 2021-04-27f432d3fc41cmd/compile: fix nongeneric closures in generic functions + 2021-04-278ab7064e33cmd/go: use a real Go version in the go.mod files in TestScript/mod_readonly + 2021-04-270c3557e6adsyscall: move TestForegroundSignal create call out of goroutine + 2021-04-27291eb0178fgo: various minor cleanups with the help of Goland + 2021-04-270ae9c3b98bruntime/pprof: fix block profile bias + 2021-04-278e0023b81bcmd/go/internal/load: treat packages with errors as potentially main packages + 2021-04-27bd2175e1b1cmd/go: show warnings about symlinks only for patterns containing ... + 2021-04-27222101549asyscall: restore nosplit for ptrace1 on Darwin + 2021-04-27cde6a675bcgo/scanner: optimize scanIdentifier + 2021-04-27074a49bfe8strconv: remove unused extfloat (Grisu3) ftoa code + 2021-04-2755c517a8b3cmd/compile: fix handling of ir.CurFunc during stenciling + 2021-04-27d553c0144dbits: use same expression with system bit size + 2021-04-27bc6288794dgo/scanner: improve variety in benchmarks for file scanning + 2021-04-276fa12172d9go/parser: add benchmarks for syntax-only parsing and object resolution + 2021-04-2788a8a27056os: don't check non-nil err twice in Symlink on windows + 2021-04-270b9ca4d907runtime/metrics: add tiny allocs metric + 2021-04-277d22c2181bsyscall: restore signal mask after setting foreground process group + 2021-04-2739844971fbgo/types: don't panic when checking a ListExpr in exprInternal + 2021-04-276edd573218cmd/link: enforce larger alignment on split ppc64 text sections + 2021-04-271eca6aa747cmd/internal/obj: refactor ppc64 address relocation code generation + 2021-04-27e0815d041cruntime: replace --buildmode with -buildmode in tests + 2021-04-27ca8e8317beruntime: add missing import "C" in TestLibraryCtrlHandler + 2021-04-27cb34026a95cmd/compile: tighten exportWriter.qualifiedIdent signature + 2021-04-27c249491572doc: change <a/> to </a> in spec + 2021-04-277ef0237d89cmd/go/internal/modload: clean up error reporting + 2021-04-273cc3a16029cmd/go: add tests for convergence in 'go mod tidy' + 2021-04-27434e12f772cmd/compile: add more doc for Name.Defn + 2021-04-2715105dd4b5go/types: walk all imports when determining package name ambiguity + 2021-04-2740254ec0dbcmd/compile: fix wrong package path for unsafe.Pointer + 2021-04-26903b25178esyscall: on linux use accept4 in Accept, fall back to accept + 2021-04-26be28caf0aacmd/compile/internal/types2: respect IgnoreFuncBodies for function literals + 2021-04-269f601690dacmd/compile: workaround inlining of closures with type switches + 2021-04-26a53dc4c1cecmd/go/internal/modload: use (*loadPkg).mod only to indicate the module from which the package was loaded + 2021-04-260d1280c685Revert "sync: improve sync.Pool object stealing" + 2021-04-26c430313992runtime: use abi.FuncPCABI0 for libc syscall wrappers + 2021-04-268ff1da0b81runtime: fix offset in comment + 2021-04-2614ade57ab8runtime: fix scavenge min fraction constant floor division + 2021-04-26d02026414ccmd/go: don't add generated SWIG C++ files to CompiledGoFiles + 2021-04-26d5d24dbe41sync: improve sync.Pool object stealing + 2021-04-261f7ddf57d2syscall, etc.: use abi.FuncPCABI0 for libc syscall wrappers + 2021-04-2600d42ffc89cmd/compile: spos handling fixes to improve prolog debuggability + 2021-04-2470deaa33ebcmd/compile: extend GOSSAFUNC match to well-formed package suffix match. + 2021-04-23e7db792fc5runtime: simplify TestSelectStackAdjust + 2021-04-23b8fed48a9acmd/dist: enable cgo on windows/arm64 + 2021-04-23a6d3dc40c4misc/cgo/testso, misc/cgo/testsovar: fix for Windows + 2021-04-239cc3469106all: do not test internal linking on windows/arm64 + 2021-04-238e368708c5cmd/link: implement windows/arm64 external linking + 2021-04-23bf9216055bruntime/testdata: fix testprogcgo for windows/arm64 + 2021-04-23a25d1d45d9runtime: fix windows/arm64 callbackasm1 for frame pointer hack + 2021-04-2316330817aaruntime: add windows/arm64 cgo-linking code + 2021-04-23e5a6c5243ccmd/link: force external link for windows/arm64 cgo binaries + 2021-04-2379f35130cdcmd/link: expand PE constants and fix doc URL + 2021-04-23a0248a99a8cmd/link: fix PE emitRelocations for >4GB base address + 2021-04-2359ceb985c7cmd/link: make Loader.SymName not crash + 2021-04-23199575a119cmd/link: count relocations better + 2021-04-2341e5ae4883cmd/link: deal with no constructors + 2021-04-239f7079c44ecmd/link: sort the pclntab relocations + 2021-04-23c0e1301b8ccmd/link: fix PE section attributes for windows/arm64 + 2021-04-23073f913949debug/dwarf: skip over zero-length compilation units + 2021-04-23cef3a442eacmd/asm, cmd/link: use full objabi header + 2021-04-2319470dc535misc/cgo/test: do not redeclare exported Go functions + 2021-04-231421516973cmd/compile, internal/abi: add FuncPCABIxxx intrinsics + 2021-04-23691e1b84c1cmd/compile: generalize fix for lvalue-init evaluation + 2021-04-23768a39975dcmd/go/internal/modload: remove the addedModuleFor map + 2021-04-23c3e2ed711ccmd/go: use builtin version and reexec for env + 2021-04-23d2f96f2f75math/rand: make the security warning clearer and more prominent + 2021-04-238c66669764cmd/compile: make sure ascompatee walk lhs init statements + 2021-04-23d4bfe00615cmd/go: make build cache tag sensitive to GOSSADIR; remove unused + 2021-04-23bedfeed54aruntime,runtime/metrics: add metric to track scheduling latencies + 2021-04-23105a6e9518os: skip TestExecutableDeleted on aix + 2021-04-235963f0a332cmd/vendor: get golang.org/x/tools@f946a157eef + 2021-04-23d310b2a6b8cmd/compile: set correct Defn for inlined vars + 2021-04-231b0a031680cmd/compile: escape "go" wrapper closure everywhere + 2021-04-23cfac62a1cccmd/compile: fix bug in defer wrapping + 2021-04-2314056d0d00cmd/compile/internal/types2: add unsafe.Add and unsafe.Slice + 2021-04-23050b408dccgo/types: implement unsafe.Add and unsafe.Slice + 2021-04-221da05eb0cespec: add unsafe.Add and unsafe.Slice + 2021-04-2274059685fdgo/types: suppress index-out-of-bounds error on Unknown constants + 2021-04-22f7afdfd483go/types: cleanup and fix Checker.index + 2021-04-22cfe5d79c5cos: depend on Readlink only when necessary + 2021-04-22ecfce58965runtime: skip work recheck for non-spinning Ms + 2021-04-22b6ff3c69d5cmd/link: support more load commands on Mach-O + 2021-04-221a5665533bcmd/go/internal/modload: migrate editBuildList to use a structured requirement graph + 2021-04-229c1b769d5fcmd/go: add a source file in the multiple-paths module in TestScript/mod_tidy_replace + 2021-04-22537cde0b4bcmd/compile, runtime: add metadata for argument printing in traceback + 2021-04-22d4aa72002ecmd/asm: fix RLDCR const1,reg,const2,reg on ppc64 + 2021-04-22e8666abd98cmd/compile: keep call's args in elim dead auto pass + 2021-04-22d3853fb4e6runtime: call cgocallbackg indirectly + 2021-04-22d5b2d809b0cmd/link: emit LC_BUILD_VERSION on Mach-O + 2021-04-22b2a032add8cmd/link: update machoPlatform selection + 2021-04-22a4f3ff2205cmd/go: update TestScript/mod_convert + 2021-04-2214a18b7d25cmd/compile/internal/types2: move a handful of tests + 2021-04-22a71528ad31cmd/compile/internal/types2: review fixedbugs tests + 2021-04-22ece5935364cmd/compile/internal/types2: better errors for invalid short var decls + 2021-04-2248b368b01fcmd/compile/internal/types2: avoid follow-on errors for invalid [...] array + 2021-04-22617a83ec68go/types: re-enable a commented out test + 2021-04-22f0a8101d34go/types: combine two loops (cleanup of TODO) + 2021-04-225daefc5363cmd/internal/obj/arm64: fix the wrong ROR operator of some instructions + 2021-04-220636d88f6dcmd/compile: add restrictions on the shift amount range of arm64 various instructions + 2021-04-2202a8e83661runtime: don't run TestCrashDumpsAllThreads in parallel + 2021-04-217bedd47798go/types: combine all type inference in a single function + 2021-04-216639bb894druntime: call nanotimeQPC from nanotime1 normally + 2021-04-217e97e4e8ccsyscall: syscall.AllThreadsSyscall signal handling fixes + 2021-04-2154af9fd9e6internal/bytealg: add power9 version of bytes index + 2021-04-21122fca49f9go/types: simplify Checker.Call + 2021-04-211d2101116fnet: don't check nil err twice in interfaceMessages on freebsd + 2021-04-21614a9c2613go/types: simplify Checker.funcInst + 2021-04-2139785912b9go/types: add sizeof test + 2021-04-21255056395etest: add a field tracking test + 2021-04-2135806efda2io/fs: document that caller can modify slice returned by ReadFile + 2021-04-21b8a359d984cmd/compile/internal/types2: fix incorrect result type of Checker.index + 2021-04-21f9e2dbbfc9syscall: use libc in Exec on openbsd/arm64 + 2021-04-21e5bc4f2a77cmd/compile: reenable name preservation on copies in expand_calls + 2021-04-21daee726a0bcmd/compile: don't accumulate duplicated named slots + 2021-04-214d56576ec0runtime: move timer recheck after GC recheck + 2021-04-21381252f312cmd/go/internal/modload: use updateRequirements instead of editRequirements to add modules for missing packages + 2021-04-215f1df260a9cmd/compile: allow export/import OSLICE2ARRPTR + 2021-04-217735ec96c1cmd/compile: remove ir.OSTMTEXPR op + 2021-04-21acf1b46de5cmd/compile: update ir.Node ops comments + 2021-04-21f53c2fac46cmd/go/internal/modload: in newRequirements, verify that rootModules is sorted + 2021-04-2169c94ad55fcmd/go/internal/modload: split updateRoots into separate functions for updating and tidying + 2021-04-2181fcb18df5cmd/go: make Tidy an option in PackageOpts rather than a separate call + 2021-04-21c33ced6d8aruntime: don't test sig.inuse in sigsend + 2021-04-21190cb937f7cmd/compile/internal/types2: fix type inference + 2021-04-21760d3b2a16reflect: allow conversion from slice to array ptr + 2021-04-21c18744377ago/types: allow conversion from slice to array ptr + 2021-04-21faa4fa1a6ecmd/compile: allow conversion from slice to array ptr + 2021-04-201c268431f4spec: allow conversion from slice to array ptr + 2021-04-20e12b0afa54cmd/compile: separate out parameter and field export encoding + 2021-04-2048e3d92454Revert "runtime: implement runqdrain() for GC mark worker goroutines" + 2021-04-20c7d708e42ecmd/compile: pass struct field note information along in exported info + 2021-04-20f448cb8ba8cmd/compile: use f.Nname.Type() in makeABIWrapper + 2021-04-2057b0d838ednet: pass MSG_CMSG_CLOEXEC in ReadMsgUnix on dragonfly, netbsd and openbsd + 2021-04-203f8e64878ainternal/poll, net: fix comments regarding accept and sysSocket + 2021-04-20dbade774c3runtime: refactor findrunnable spinning recheck + 2021-04-207473a6a0ebreflect: fix stack overflow panic when using haveIdenticalUnderlyingType + 2021-04-20fbb600b283runtime: implement runqdrain() for GC mark worker goroutines + 2021-04-2077860ad280cmd/compile: guard partially live arg spilling with number of registers + 2021-04-20109d7580a5cmd/compile: disable name preservation on copies in expand_calls + 2021-04-2060ab197bc2runtime: refactor work stealing to dedicated function + 2021-04-209dd71ba913internal/buildcfg: enable regabiargs by default + 2021-04-2024875e3880cmd/compile/internal/types2: fix some typos in rawLookupFieldOrMethod + 2021-04-204ce49b4a15go/types: support type parameters in NewMethodSet + 2021-04-20af8a176e91internal/buildcfg: enable regabidefer by default + 2021-04-203ff6ff7f84cmd/compile: preserve pointerness when creating map key temp + 2021-04-20fe26dfadc3net: use syscall.fcntl on libc systems + 2021-04-200ccdcb2102runtime: crash the GC when clobberdead pointer is seen + 2021-04-204f5aec4603all: remove redundant spaces before . and , + 2021-04-209f87943424go/types: fix panic when using multiple type arguments + 2021-04-193711ea0b5dcmd/compile: do not clobber arguments for reflect.callReflect and callMethod's ABI wrappers + 2021-04-19b3a5640397go/types: remove the concept of finals + 2021-04-1962cad233a6go/types: remove stale commented-out testdata + 2021-04-197252e1e5b6cmd/link: convert -I foo to -Wl,--dynamic-linker,foo when externally linking + 2021-04-1988655480f3internal/buildcfg: enable regabireflect by default + 2021-04-19bc5de81e70testing: remove data races so that parallel benchmarks can safely call .Fatal* and .Skip* + 2021-04-19e97d8eb027net: pass MSG_CMSG_CLOEXEC flag in ReadMsgUnix + 2021-04-19bbb510ccc9internal/buildcfg: enable regabig by default + 2021-04-19f8892147bdruntime: open up space for callee's arg spill slot in mcall (regabi version) + 2021-04-195780ab4f60text/template/parse: add a mode to skip func-check on parsing + 2021-04-196b8e3e2d06cmd/compile: reduce redundant register moves for regabi calls + 2021-04-19b21e739f87test: add test for CL 310589 + 2021-04-19a9c244a849test: add liveness test for regabi + 2021-04-19a72622d028cmd/compile: skip "_" function in reflectdata.MarkUsedIfaceMethod + 2021-04-19c914e6160dcmd/go: drop GOEXPERIMENT in script tests + 2021-04-184efd581383archive/zip: fix imports block of biggestZipBytes generator + 2021-04-17fd3612e433internal/buildcfg: enable regabiwrappers by default + 2021-04-1643466399cbinternal/buildcfg: make regabi enable regabiargs + 2021-04-16067bad2eefruntime: update stale comment + 2021-04-1614dbd6e776internal/buildcfg: make regabi an alias for regabi sub-experiments + 2021-04-1694817890c2runtime: remove useless nFlushCacheRoots + 2021-04-16b05903a9f6cmd/link: fix defaultGOROOT package + 2021-04-16b65f8589e8cmd/dist: defend self against misc/reboot test + 2021-04-1602a2ff47efgo/parser: add a SkipObjectResolution mode to bypass object resolution + 2021-04-16b91f8a4c0bgo/scanner: fix a typo in scanner_test.go + 2021-04-169e8a312b71go/parser: move type params in scope for the function signature + 2021-04-1613368ab56aruntime: clarify which work needs spinning coordination + 2021-04-16800fb11efbruntime: remove redudant tryWakeP component + 2021-04-16f6e7fe2711runtime: move findrunnable timer delay computation closer to use + 2021-04-169fbcba6664cmd/compile: in clobberdead mode, don't clobber slots that are live for defers + 2021-04-164fb74e0555reflect: preserve ctxt across moveMakeFuncArgPtrs + 2021-04-16b6e1c33603cmd/compile: spill all the parameters around morestack + 2021-04-16fff236e659net/http/fcgi: eliminate race, keep request id until end of stdin + 2021-04-16ef57834360crypto/tls: fix flaky handshake cancellation tests + 2021-04-16dba89283adcmd/go, go/build: add ToolTags to build.Default + 2021-04-1695ed5c3800internal/buildcfg: move build configuration out of cmd/internal/objabi + 2021-04-162fc0ebb623cmd/go/internal/modload: when outside a module, set cfg.BuildMod based on allowMissingModuleImports + 2021-04-16c1e8a9a8c6net/http/cgi: Remove hard-coded ServeHTTP timeout + 2021-04-16492eb059f9cmd/go: fix mod_install_pkg_version + 2021-04-1660abe01321cmd/link: fix file-local checks in xcoff + 2021-04-16acb189ea59net/http: make ReadRequest return an error when requests have multiple Host headers + 2021-04-162f0e5bf907net/http: using errors.Is in fs error detection + 2021-04-16abbb82957dcmd/compile: don't insert VarDef for already-initialized results + 2021-04-1604e1176fd2cmd/go: support 'go run cmd@version' + 2021-04-16639cb1b629runtime: mark stdcallN functions cgo_unsafe_args + 2021-04-160613c748e8cmd/go: move 'go install cmd@version' code into internal/load + 2021-04-16dc76c47565cmd/go/internal/load: convert two global flags to an options struct + 2021-04-16cde92846e2doc: add release note for module deprecation + 2021-04-1652df9291aatest/abi: reenable test on windows + 2021-04-16c692f752b5cmd/link/internal/ld: re-enable tests on darwin + 2021-04-16e1f4feb3d6cmd/link/internal/ld: fix GOARCH in TestAbstractOriginSanityIssue25459 + 2021-04-16d26fc68aa1cmd/internal/objabi,test: use correct GOEXPERIMENT build tags in test/run.go + 2021-04-16cf2396c70einternal/goexperiment: move baseline configuration to objabi + 2021-04-16f08c552dabnet/http: add to deadlines only when positive + 2021-04-16bdddfd10ecruntime: improve synchronization in TestFinalizerRegisterABI + 2021-04-15c8fb0ec5a0cmd/compile: fix ANDI/SRWI merge on ppc64 + 2021-04-15699a7c0fe9cmd/go/internal/modconv: involve GOPROXY in ConvertLegacyConfig + 2021-04-157ed6d1f2fbcmd/compile/internal/types2: add sizeof test + 2021-04-15a63ff398d5cmd/compile/internal/syntax: fix error message for ... without type + 2021-04-15ddd8d7c0a6cmd/internal/obj: consolidate AMOVW and AMOVWZ optab entries + 2021-04-158009a81f7abytes: add asm implementation for index on ppc64x + 2021-04-155631c4b3bfnet/http: allow multiple dials in TestTransportMaxConnsPerHost + 2021-04-151d20a362d0math: avoid assembly stubs + 2021-04-1531e12b953acmd/link: issue error if elf header overruns + 2021-04-157ad496b6f5runtime: unify C->Go ABI transitions + 2021-04-15dba2eab826runtime,runtime/cgo: save all necessary registers on entry to Go on Windows + 2021-04-153e0b1cdb5druntime: minor refactoring of _rt0_amd64_lib + 2021-04-15b1c4cc5589mime: keep builtinTypesLower sorted alphabetically + 2021-04-1561a08fc6cestrconv: Implement Ryū algorithm for ftoa shortest mode + 2021-04-150184b445c0strconv: implement Ryū-like algorithm for fixed precision ftoa + 2021-04-158f4c5068e0internal/bytealg: port more performance-critical functions to ABIInternal + 2021-04-1548b7432e3fcmd/internal/obj/arm64: fix the wrong sp dst register of ADDS/SUBS instructions + 2021-04-15566a87c16btime: add missing "os" import to zoneinfo_test.go + 2021-04-15083a26c7d2cmd/compile: propagate pragmas from generic function to stenciled implementation + 2021-04-15bf634c76b2cmd/compile: look for function in instantiations in all global assignments + 2021-04-14567a9322admime: add mime type for avif image file format + 2021-04-14d27bb8ba2ego/build: replace os.Setenv with T.Setenv + 2021-04-14f18715c18ftime: replace os.Setenv with T.Setenv + 2021-04-14c3931ab1b7net/http/httptest: panic on non-3 digit (XXX) status code in Recorder.WriteHeader + 2021-04-14cbf9caaf22cmd/go: add a Go source file in TestScript/mod_sumdb + 2021-04-1423f8c203f0cmd/compile: rework/reduce partially lived argument spilling + 2021-04-141a8f0a7961runtime: fix data race in abi finalizer test + 2021-04-14a89ace106fruntime: update debug call protocol for register ABI + 2021-04-14de7a87ef06go/internal/gccgoimporter: replace os.MkdirTemp with T.TempDir + 2021-04-14d1f8104b58time: move slim test tzdata to testdata directory + 2021-04-14b161b57c3fgo/build: replace os.MkdirTemp with T.TempDir + 2021-04-14892cad7a9bcmd/compile/internal/types2: add Named.SetTParams and Named.Orig methods + 2021-04-14283f9fdbd3cmd/dist: add tests using the typeparams build tag + 2021-04-14bcbde83c20go/ast: fix broken build with typeparams build constraint + 2021-04-14492faaeda8os/exec: replace os.Setenv with T.Setenv + 2021-04-144df3d0e4dfcmd/compile: rescue stmt boundaries from OpArgXXXReg and OpSelectN. + 2021-04-144480c822bacmd/internal/obj: don't emit args_stackmap for ABIInternal asm funcs + 2021-04-1425b25a9ed7cmd/asm: require NOSPLIT for ABIInternal asm functions + 2021-04-14ef36e4fd0ereflect: keep pointer register results alive in callMethod + 2021-04-14ad44dfb0fdcmd/go: clarify comment on HashSeed + 2021-04-14c98026c104cmd/go/internal/modload: fix truncated error message from goModDirtyError + 2021-04-1472483de87aruntime: incorporate hbits advancement in scanobject into loop + 2021-04-147ec7a3cf33runtime: make gcEffectiveGrowthRatio a method on gcControllerState + 2021-04-14e9cc31e736runtime: pass work.userForced to gcController.endCycle explicitly + 2021-04-143eaf75c13aruntime: move next_gc and last_next_gc into gcControllerState + 2021-04-14e224787fefruntime: fix formatting of gcMark + 2021-04-1482e4a6310bruntime: move roots' bases calculation to gcMarkRootPrepare + 2021-04-14ab02cbd29fruntime: increase maxargs to avoid syscall18 crash when called with more than 16 args + 2021-04-1458fdac04e4syscall: don't defer close raw Socketpair fds in tests + 2021-04-146d8ba77896cmd/compile: fix importing of method expressions + 2021-04-14e7ab1a5ba8runtime: create setGCPercent method for gcControllerState + 2021-04-149bce7b70fdruntime: create initializer for gcControllerState + 2021-04-142d4ba2601bruntime: move gcPercent and heapMinimum into gcControllerState + 2021-04-14728e3dc6f9runtime: make gcSetTriggerRatio a method of gcControllerState + 2021-04-14eb433ed5a2cmd/compile: set types properly for imported funcs with closures + 2021-04-148dcc071063cmd/compile/internal/types2: use a global atomic counter for type parameter ids + 2021-04-1334620364cbruntime, cgo/test: improve debugging output + 2021-04-13f2d5bd1ad3runtime: move internal GC statistics from memstats to gcController + 2021-04-138c2a8b1771cmd/compile: always zero the temporary in mapKeyTemp + 2021-04-13b4881d930acmd/compile: don't modify underlying type when creating bitmap for bodyless function + 2021-04-13efaf75a216go/*,cmd/gofmt: guard AST changes with the typeparams build tag + 2021-04-13693859542eruntime: rename gcpercent, readgogc, and heapminimum to match Go style + 2021-04-13f5f7647107runtime: break out GC pacer into its own file + 2021-04-139913f821e2cmd/compile: make map functions ABI insensitive + 2021-04-13c19759aa48runtime: eliminate externalthreadhandler + 2021-04-13e69f02265cruntime: use newm for profileloop + 2021-04-13e512bc2cf0runtime: use compileCallback for ctrlhandler + 2021-04-13069983e5dbarchive/tar: replace os.MkdirTemp with T.TempDir + 2021-04-133bf645a633cmd/link: force external linking for DragonFly cgo programs + 2021-04-1369262d4871cmd/compile,cmd/link: resolve cgo symbols to the correct Go ABI + 2021-04-1348531da9e7cmd/link: build dynexp symbol list directly + 2021-04-13007e247af1cmd/link: move cgo export map from loadcgo to setCgoAttr + 2021-04-136208b10d1ecmd/link: refactor setCgoAttr + 2021-04-1310f883deb7cmd/cgo: document generated cgo directives + 2021-04-137b19fb1d56mime: in globs2 file only keep first time extension is seen + 2021-04-1339dd96ca5acmd/compile/internal/types: add example test for type inference + 2021-04-134b00eb7af4cmd/compile: allow OpArgXXXReg comes before LoweredGetClosurePtr + 2021-04-13444d28295btest: make codegen/memops.go work with both ABIs + 2021-04-1313a4e8c41call: simplify the spelling of Linux + 2021-04-133e5bba0a44cmd/link: support 32b TLS_LE offsets on PPC64 + 2021-04-13d948b8633dcmd/go: fix 'go help mod edit' JSON documentation + 2021-04-1249e933fc57cmd/compile: make interface conversion function selection ABI insensitive + 2021-04-12841bc14216os: restore testErrNotExist's working directory on os.Chdir success + 2021-04-12263e13d1f7test: make codegen tests work with both ABIs + 2021-04-123d5e3a15f6debug/pe: replace os.MkdirTemp with T.TempDir + 2021-04-12c27991bf5btext/template: replace os.MkdirTemp with T.TempDir + 2021-04-12cccd3ba912internal/execabs: replace ioutil.WriteFile with os.WriteFile + 2021-04-12aad13cbb74runtime: non-strict InlTreeIndex lookup in expandFinalInlineFrame + 2021-04-125c9b6e8e63net: never probe IPv4 map support on DragonFly BSD, OpenBSD + 2021-04-123e8ba91275mime: support reading shared mime-info database on unix systems + 2021-04-121b736b3c19runtime: consolidate "is sweep done" conditions + 2021-04-12a25a77aed2runtime: block sweep completion on all sweep paths + 2021-04-1207b2fee460cmd/link: fix TestLargeText + 2021-04-12849dba07a5runtime: port performance-critical functions to regabi + 2021-04-12865d2bc78ecmd/compile: do not allocate space for unspilled in-register results + 2021-04-128b859be9c3internal/poll: ensure that newPoolPipe doesn't return a nil pointer + 2021-04-122fa7163b06cmd/compile: look for newobject in register ABI for write barrier elision + 2021-04-125d80f8a82bruntime: replace outdated documentation link in Windows' nanotime + 2021-04-1233d99905dacmd/compile: preserve name association when eliding copies in expand_calls + 2021-04-1270ed28e5f7cmd/compile: support memmove inlining with register args + 2021-04-12585b52261cruntime: remove deferreturn dummy argument + 2021-04-129ed0e32059test: consider default GOEXPERIMENT when matching build tags + 2021-04-1251a47b7ff2cmd/go: display helpful error when module cache can't be created + 2021-04-12117b1c84d3cmd/go/internal/work: remove '_test' from import paths in stacktraces when -trimpath is specified + 2021-04-12c26f954a54cmd/compile/internal/amd64: follow-on regabi fix for amd64 zerorange + 2021-04-1216cd770e06cmd/cgo: throw if C.malloc returns NULL in C.CString or C.CBytes + 2021-04-12954bd8203bcmd/cgo: use tabs to indent _cgoPREFIX_Cfunc__CMalloc function body + 2021-04-12e12abe4bd6net: fix (*ipStackCapabilities).probe godoc + 2021-04-127beb988a3bruntime: using wyhash for memhashFallback on 64bit platform + 2021-04-12424abc8d3bos/signal: replace os.MkdirTemp with T.TempDir + 2021-04-110da9eff503runtime: simplify syntax for pointer arithmetic in mapaccess functions + 2021-04-11352d329c44runtime: move zero-sized frame check from newproc to newproc1 + 2021-04-11189c6946f5net: reference the correct RFCs and sections for IP.IsPrivate + 2021-04-103f4977bd58cmd/compile/internal/types2: use combined type and ordinary args for type inference + 2021-04-10a6d95b4508cmd/compile/internal/types2: split out function instantiation from index expr + 2021-04-1036c5f902f9cmd/compile/internal/types2: factor out index/slice expr handling + 2021-04-104638545d85cmd/compile/internal/syntax: accept "~" and "|" interface elements + 2021-04-101129a60f1ccmd/compile: include typecheck information in export/import + 2021-04-1011f159456bpath/filepath: replace os.MkdirTemp with T.TempDir + 2021-04-106382ec1abainternal/poll: fix the intermittent build failures with pipe pool + 2021-04-1052bf14e0e8all: fix spellings + 2021-04-09554d2c4f06reflect: panic on New of go:notinheap type + 2021-04-095305bdedb0test: do not run (another) softfloat test with regabiargs + 2021-04-09281d168e2dcmd/compile: don't set Ntype in noder2 anymore + 2021-04-09756e2b1529cmd/internal/objabi: make GOEXPERIMENT=none mean "no experiment flags" + 2021-04-09c3faff7f2dcmd/go/internal/modload: change mvsReqs to store roots instead of a full build list + 2021-04-09814c5ff138cmd/go: support module deprecation + 2021-04-09952187af12cmd/go: upgrade and vendor golang.org/x/mod + 2021-04-09fcf8a6640bcmd/compile/abi-internal: declare R14 completely fixed + 2021-04-090ad46889a1cmd/compile/abi-internal: declare X15 scratch in function bodies + 2021-04-092698be4905runtime: use sigpanic0 on all OSes + 2021-04-09d11968012ctest/abi: disable test with old-style build tag known to run.go + 2021-04-096951da56b0Revert "cmd/compile: ensure spills of int/float reg args land in abi slots" + 2021-04-0977b3269fb5cmd/go: in TestScript, set GOTRACEBACK and use SIGQUIT to terminate hung subprocesses + 2021-04-09a690a5d75fcmd/compile: ensure spills of int/float reg args land in abi slots + 2021-04-09d138ee2cfbtest/abi: disable test on windows for now + 2021-04-09dcc801ef81cmd/go/internal/modload: actually set the depth field passed to newRequirements + 2021-04-09c432917061cmd/link: link libgcc archive after mingw archives + 2021-04-09519f223aa2cmd/compile: reduce overhead of RParams in types.Type + 2021-04-094d7d7a4c50os: replace os.MkdirTemp with T.TempDir + 2021-04-098518aac314crypto/x509: replace os.MkdirTemp with T.TempDir + 2021-04-09d25c4fbe05test: do not run softfloat test with regabiargs + 2021-04-0919034fa855cmd/objdump: update test with register ABI + 2021-04-085811605df9cmd/go: fix mod_list_update_nolatest on windows + 2021-04-08d67e739989os/exec: replace os.MkdirTemp with T.TempDir + 2021-04-08ec367e5b05cmd/compile: adjust interface conversion function selection with 0-sized fields + 2021-04-086c98ecda10cmd/compile: don't use fast32/64 map functions for aggregates + 2021-04-08a9e475a15acmd/compile: add recursive-invalidate Value method, use in expand_calls + 2021-04-087e583806d8runtime/cgo: clarify Handle documentation + 2021-04-08bb76193a7fcmd/compile: fix buglet in walk convert phase relating to convF32/64 + 2021-04-08793844207dcmd/go: strip GOEXPERIMENT from hash salt + 2021-04-0898dd205fa4runtime: see whether gp==nil before checking preemption state + 2021-04-0846ffbec1d6cmd/compile: break out transformations of tcCompLit into transformCompLit + 2021-04-08ecca94a7d1cmd/go/internal/modload: add a dormant depth type + 2021-04-0896a6745088runtime: use register ABI in panicIndex/Slice functions + 2021-04-08ca8540affdcmd/compile: fix buglet in walk convert phase relating to convT64 + 2021-04-08d474b6c824test/abi: clean up test to fix builders + 2021-04-0823e1d36a87cmd/go: in 'go list -m', ignore "not found" errors loading updates + 2021-04-080e09e4143ecmd/go: assume Go 1.16 semantics uniformly for unversioned modules + 2021-04-0831d2556273runtime: set up read-only dummy TLS space for needm on Windows + 2021-04-08283b02063bcmd/compile: sanitize before/after expansion OpSelectN references + 2021-04-081be8be4acccmd/go: fix TestNewReleaseRebuildsStalePackagesInGOPATH + 2021-04-08912c4e29d3reflect: fix typo in result-in-registers case + 2021-04-081749f3915esync: update misleading comment in map.go about entry type + 2021-04-08a7e16abb22runtime: replace os.MkdirTemp with T.TempDir + 2021-04-082123dfba65Revert "cmd/compile/internal/noder: limit the number of goroutine" + 2021-04-088752454ececmd/internal/objabi: clarify initialization of Experiments + 2021-04-085159c83641runtime,cmd/link: include GOEXPERIMENTs in runtime.Version(), "go version X" + 2021-04-08a8e55538afcmd/internal/objabi: make GOEXPERIMENT be a diff from default experiments + 2021-04-0889ca1ce9a8cmd/compile,cmd/internal/objabi: abstract out object header string + 2021-04-08b675e52e95internal/goexperiment: consolidate experiment-enabled constants + 2021-04-086304b401e4internal/goexperiment,cmd: consolidate GOEXPERIMENTs into a new package + 2021-04-080c4a08cb74cmd/asm,runtime: reduce spellings of GOEXPERIMENTs + 2021-04-08aeaa4519b5runtime: drop haveexperiment, sys.GOEXPERIMENT + 2021-04-07f60aa7a18csyscall: replace os.MkdirTemp with T.TempDir + 2021-04-07fca51ba24acmd/internal/obj: remove ppc64 msr support from MOV* insns + 2021-04-07e306d06063runtime/map: update comment for gc/reflect + 2021-04-07b3064b66d0cmd/compile/internal/types2: combine two loops (cleanup of TODO) + 2021-04-074520da486bcmd/pack: use testing.T.TempDir in tests + 2021-04-07b55d900529cmd/compile: correct argument area size for typedmemmove/typedmemclr + 2021-04-07d6aa162f30embed, testing/fstest: small optimization for ReadDir + 2021-04-075d5f779db4net/http: replace os.MkdirTemp with T.TempDir + 2021-04-074bbe046aadcmd/compile/internal/syntax: add "~" operator + 2021-04-07836356bdaacmd/compile/internal/types2: process errors in src order during testing + 2021-04-078f1099b585cmd/compile/internal/syntax, types2: move cmpPos to pos.Cmp + 2021-04-071395432f23cmd/compile/internal/types2: remove Config.AcceptMethodTypeParams flag + 2021-04-077d5c54eee4cmd/compile/internal/types2: remove Config.InferFromConstraints flag + 2021-04-07bce85b7011cmd/compile/internal/types2: combine all type inference in a single function + 2021-04-078462169b5acmd/compile: pre-spill pointers in aggregate-typed register args + 2021-04-078d77e45064cmd/compile: fix bug of conditional instructions on arm64 + 2021-04-06972e883925runtime/cgo: add Handle for managing (c)go pointers + 2021-04-06b084073b53reflect: refactor funcLayout tests + 2021-04-060a510478b0runtime: use register ABI for race detector functions + 2021-04-067da8490cbbpath/filepath: replace os.MkdirTemp with T.TempDir + 2021-04-060bc4605eadcmd/go/internal/modload: track conflicts in versionLimiter + 2021-04-06b56177a303cmd/compile: check for unused OpArg* and mark invalid (again) + 2021-04-06f5efa5a313cmd/compile: load results into registers on open defer return path + 2021-04-06bcc4422ee1runtime: deflake TestGCTestIsReachable + 2021-04-061271e9a9cctime: properly quote strings containing quotes and backslashes + 2021-04-062e6f39beb0cmd/go/internal/modload: factor out a method to update loader requirements + 2021-04-06d6a90d06d2cmd/compile/internal/types2: simplify Checker.Call + 2021-04-063a30381b21cmd/compile/internal/types2: simplify Checker.funcInst + 2021-04-0693466cc1b6cmd/compile/internal/types2: review of pos.go and move into syntax package + 2021-04-06d57189e92btest/syntax: remove interface.go + 2021-04-0655bac87bd6runtime/pprof: deflake TestMorestack + 2021-04-06b345a306a0cmd/compile: when GOSSAFUNC is set, dump the current pass on crash + 2021-04-06939b561a6ecmd/internal/obj: reorg ppc64 MOV* optab entries and remove unused classes + 2021-04-065cd8a34495cmd/compile: fix gcSizes.Sizeof for a zero-sized struct + 2021-04-0684162b8832cmd/compile/internal/typecheck: call tcConv directly + 2021-04-06a25c584629os: implement fs.StatFS for os.DirFS + 2021-04-06d8306ee1f9runtime: make reflectcall ABI0 on amd64 + 2021-04-06298975c634runtime: use funcID to identify abort in isAbortPC + 2021-04-05b2389ad3cecmd/compile: fix for zerorange on plan9-amd64 + 2021-04-05d446cb7cffreflect: call ABI0 callReflect/callMethod + 2021-04-050723f062ffcmd/compile: enable panic+recover adjustment for some ABI wrappers + 2021-04-0579b2e14b1acrypto/ed25519: add comprehensive edge-case test vectors + 2021-04-0527015152ecflag: use strings.Builder instead of concatenating strings + 2021-04-05ee40bb666bcmd/compile: add "surprised by IData of Arg" case for register args + 2021-04-05254fb85c12cmd/go: print deprecation notice for 'go get cmd' + 2021-04-05d5b9dc1317cmd/cgo: pass end position info for C function arguments. + 2021-04-05e985245cd5net: make ErrClosed and ParseError implement net.Error + 2021-04-05a1a45afd4acmd/internal/obj: remove duplicate ppc64 spr MOV* optab entries + 2021-04-05a11244e95etime: use offset and isDST when caching zone from extend string + 2021-04-05cf148f3d46cmd/compile, runtime: use ABI-aware function converting float to interface + 2021-04-05a040ebeb98all: update references to symbols moved from io/ioutil to io + 2021-04-059abedf4827cmd/compile/internal/ssagen: conditon not need + 2021-04-055cc5576a9ccmd/compile: untangle Wrapper and ABIWrapper flags + 2021-04-0545e87cd3eccmd/compile: disable tail call for method wrappers when RegabiArgs is enabled + 2021-04-05411860251ecmd/compile: reference ABIInternal memequal_varlen + 2021-04-05e617b2b0ddcmd/compile: add a debug flag to enable/disable open-coded defers + 2021-04-05dcf85b30bacmd/link: mangle function name with ABI on Mach-O + 2021-04-059e3328e740cmd/internal/objabi: remove StackPreempt + 2021-04-05191167c2b2cmd/internal/obj/s390x: simplify huge frame prologue + 2021-04-05042f4cbb6fcmd/internal/obj/riscv: simplify huge frame prologue + 2021-04-05a06b08e7d1cmd/internal/obj/ppc64: simplify huge frame prologue + 2021-04-052b63404ddbcmd/internal/obj/mips: simplify huge frame prologue + 2021-04-054702dd67a7cmd/internal/obj/arm64: simplify huge frame prologue + 2021-04-0524dd8cfe23cmd/internal/obj/arm: simplify huge frame prologue + 2021-04-05ef3122e909cmd/internal/obj/x86: simplify huge frame prologue + 2021-04-05af1789a61cruntime: extend internal atomics to comply with sync/atomic + 2021-04-05a4b8241d97cmd/compile: get rid of Fields in types.Interface, use allMethods in types.Type instead + 2021-04-056ed045b365cmd/go: refactor modload.CheckRetractions + 2021-04-05ee51e3d895cmd/go: refactor modload.ListModules to accept bit flags + 2021-04-044230a6ebddos: don't use T.Cleanup in TestRemoveAllLongPath + 2021-04-047bfd681c2fruntime/pprof: skip tests for AIX + 2021-04-04776d8d387cos, path/filepath: use T.Cleanup to restore the original working directory + 2021-04-039e7bc80b31os: reuse readdir buffers on unix with a sync.Pool + 2021-04-03dac136f87barchive/zip: fix character device handling in fileModeToUnixMode + 2021-04-03971c7154b0io/fs: implement subFS.Sub + 2021-04-036986c02d72cmd/compile: rename newNamedTypeWithSym, add some commemnts + 2021-04-03fe587ce856cmd/dist: include "go1.x-" in devel go version strings + 2021-04-0301821137c2cmd/compile/internal/types2: review of errors.go + 2021-04-0393dcaba119cmd/compile/internal/types2: review of stmt.go + 2021-04-03a1e4657d5acmd/compile/internal/types2: review of check_test.go + 2021-04-036454b2720fcmd/compile/internal/types2: review of resolver.go + 2021-04-022ebe77a2fdcmd/internal/obj: use REGENTRYTMP* in a few more places + 2021-04-02f25d78f8e2testing: clarify when Cleanup is called + 2021-04-0235a8bbc9earuntime: make concatstring{2,3,4,5} consistent w/ compiler's use + 2021-04-0241cf18eda7reflect: fix methodValueCall frame size on mips64 + 2021-04-0234b87b4a1areflect: remove short-circuits for zero-sized types in ABI algorithm + 2021-04-02254948a50ecmd/compile: mark unused values as invalid to prevent problems in expandCalls + 2021-04-0228c5fed557reflect: add register ABI support for makeFuncStub and methodValueCall + 2021-04-026996bae5d1cmd/compile: use ABI0 for cgo_unsafe_args functions + 2021-04-02759116b3acsyscall: delete asm_windows.s + 2021-04-022d88f8f21ego/src/cmd/go/internal/work: compile "internal/abi" with "-+" + 2021-04-023651eff74ecmd/link: delete CompilationUnit.Pkg field + 2021-04-02b165085836cmd/link: remove an unused function from linker dwarf gen + 2021-04-02a78b12aea7cmd/link: remove unnecessary attrReachable test + 2021-04-02aebc0b473ecmd/compile: fix bug in phiopt pass + 2021-04-0297b3ce430bruntime: make gcTestMoveStackOnNextCall not double the stack + 2021-04-0241e8a9f1cfruntime: fix TestGCTestMoveStackOnNextCall flakes + 2021-04-025579ee169fcmd/compile: in expand calls, preserve pointer store type but decompose aggregate args + 2021-04-0127d306281creflect,runtime: assume register ABI with GOEXPERIMENT=regabiargs + 2021-04-0151cd074c59reflect: undo register count increments on register assignment failure + 2021-04-0145ca9ef5c1cmd/compile: fix register/offset calculation for trailing empty field case. + 2021-04-01e6ac2df2b1net/url: use camelCase names + 2021-04-015f646f0a98cmd/compile: fix parameter offset calculation + 2021-04-01ec721d92bfruntime: fix uses of ABIInternal PCs in assembly + 2021-04-011f29e69badcmd/compile: fix outgoing calls with GOEXPERIMENT=regabiargs + 2021-04-013304b2235acmd/compile: fix incoming ABI with GOEXPERIMENT=regabiargs + 2021-03-3187c6fa4f47cmd/internal/obj/x86: use ABI scratch registers for WRAPPER prologue + 2021-03-315d6581d747cmd/compile: deduplicate OpArg's across types + 2021-03-314acefa07b1go/parser: switch to resolving objects as a post-processing pass + 2021-03-3144dd06670fruntime: support register ABI Go functions from Windows callbacks + 2021-03-31cb42e3e979cmd/compile: schedule in-register OpArg first + 2021-03-3146fa8afca6cmd/go/internal/load/test: parse overlay files for test functions + 2021-03-31ca3aefc4a9cmd/compile: make expandCalls preserve types of pointer stores + 2021-03-31c847932804runtime: replace reflectcall of defers with direct call + 2021-03-31135c9f45eccmd/compile/internal/types2: review of operand.go + 2021-03-3134fb2b2ed5cmd/compile/internal/types2: review of decl.go + 2021-03-310e8a72b62eruntime: check for sysAlloc failures in pageAlloc + 2021-03-31c93cd86149net/http: use consistent case in URL in names + 2021-03-311d8abb3417go/parser: remove redundant list argument to Parser.shortVarDecl + 2021-03-31152ca79b73go/parser: add resolution tests for type params + 2021-03-316d2a557a4dcmd/compile: deal with call.Use correctly for noder2, allow inlining of stenciled functions + 2021-03-31f2717b31b5cmd/compile: deal correctly with unnamed function params during stenciling + 2021-03-30606e0aba74go/ast: add missing handling for ListExpr in Walk + 2021-03-30c3ec79bca9go/parser: resolve the type name when parsing a composite lit value + 2021-03-300fdd371e6bgo/parser: add data-driven tests for object resolution + 2021-03-3064ca7e2cb3cmd/compile: avoid generating duplicated in-register Arg + 2021-03-304b1a24f3cdruntime: fix G passed to schedEnabled and cleanup + 2021-03-30e0ce0af6efruntime: check that defer/go frames are empty + 2021-03-301318fb4a32cmd/compile: handle partial type inference that doesn't require function args + 2021-03-303300390ec7cmd/compile: make amd64 version of zerorange regabi-friendly + 2021-03-30c40dc677bego/doc: avoid panic on references to functions with no body + 2021-03-306cadfe2feereflect: cache IsVariadic calls in Call + 2021-03-3043afb1a220cmd/go: fix documentation on how to create new go.mod file + 2021-03-3089b141c06ecmd/compile: emit writebarriers in specified ABI + 2021-03-30c274a7c03bcmd/compile/internal/noder: limit the number of goroutine + 2021-03-30e4a4161f1fruntime: non-strict InlTreeIndex lookup in Frames.Next + 2021-03-30a81b5e4d0acrypto/elliptic: fix some typos + 2021-03-30032ef4bbfccmd/compile: fix creation of named generic types (setting of t.nod) + 2021-03-30bb2fc21c3bruntime: fix typos in comments + 2021-03-3033945869c1cmd/compile: update default ABI choices for calls and bodyless fn stack maps + 2021-03-30eeadfa2d38cmd/compile: fix various small bugs related to type lists + 2021-03-30a95454b6f3runtime: init plan9 hashkey by time + 2021-03-3006ad41642ccmd/compile: wrap defer/go call with results + 2021-03-30e27f3966bbcmd/compile: be sure to wrap defer/go calls with arguments + 2021-03-30bd6628e62dcmd/compile: check deferred nil interface call before wrapping it + 2021-03-294e1bf8ed38runtime: add GC testing helpers for regabi signature fuzzer + 2021-03-291ef114d12cruntime: abstract specials list iteration + 2021-03-294e16422da0cmd/internal/obj/ppc64: remove bogus MOVBU optab entry + 2021-03-29164a6265e7go/types: remove use of ioutil (cleanup) + 2021-03-299fbd0f64d8runtime: fix some typos + 2021-03-2967d565d281cmd/compile: restructure ABI wrapper generation, export ABI + 2021-03-29feb844f1eacmd/compile: eliminate -abiwraplimit + 2021-03-291e8fff0f7bcmd/compile: assert that function values reference ABIInternal + 2021-03-290d1423583bcmd/compile: set ir.Name.Func in more cases + 2021-03-2933b4ffc357cmd/compile: track funcsyms by ir.Name instead of types.Sym + 2021-03-292ba296da47cmd/compile: update a few stale comments + 2021-03-2924764496c7go/types: remove outdated comment + 2021-03-291a7d921aa5cmd/compile: remove typechecker calls in varDecl() + 2021-03-292abf280a28cmd/compile/internal/types2: remove 'strict' argument from several methods + 2021-03-298f676144adcrypto/rsa: fix salt length calculation with PSSSaltLengthAuto + 2021-03-29565e70fcefcmd/link/internal/ld: use linkerFlagSupported to check -Qunused-arguments + 2021-03-296f90ee36e9math: simplify comparison in FMA when swapping p and z + 2021-03-29d10241fcf6runtime: fix some typos + 2021-03-29ba6bd967d2cmd/compile/internal/ssa: strengthen phiopt pass + 2021-03-2823ffb5b9aeruntime: overwrite existing keys for mapassign_faststr variant + 2021-03-2749dccf141ftime: add Time.Unix{Milli,Micro} and to-Time helpers UnixMicro, UnixMilli + 2021-03-272de1f42857net: clear completed Buffers to permit earlier collection + 2021-03-26359f44910fcmd/compile: fix long RMW bit operations on AMD64 + 2021-03-2698a902323fcmd/vendor, cmd/pprof: use golang.org/x/term directly + 2021-03-263a0061822ecmd/compile: add arm64 rules to optimize go codes to constant 0 + 2021-03-25b587b050cacmd/compile: add transform functions for OXDOT and builtins + 2021-03-25374b190475io/fs: implement FileInfoToDirEntry + 2021-03-2511b4aee05bcmd/compile: mark R16, R17 clobbered for non-standard calls on ARM64 + 2021-03-255834ce1dd7cmd/compile/internal/ssa: unnecessary loop break + 2021-03-25691db3737ccmd/cover: use golang.org/x/tools/cover directly + 2021-03-255cec8b85e5net/http/httptest: wait for user ConnState hooks + 2021-03-257ce361737fnet: only perform IPv4 map check for AF_INET6 sockets + 2021-03-25569c86d23bcmd/compile/internal/types2: review of importer_test.go + 2021-03-25ada77d23aecmd/compile/internal/types2: review of examples test + 2021-03-252c8692d45fcmd/compile/internal/types2: review of example_test.go + 2021-03-25ffa9983b99cmd/compile/internal/types2: review of api_test.go + 2021-03-2534ef294b76cmd/compile/internal/types2: review of lookup.go + 2021-03-250fc595ec99cmd/compile/internal/types2: review of check.go + 2021-03-2574fe516c35cmd/go: add -benchtime to cacheable test flags + 2021-03-2582a1e0f9d3cmd/link: make symbol data writable before toc fixup + 2021-03-254d66d77cd2database/sql: remove unnecessary types in composite literals + 2021-03-2553941b6150cmd/compile: fix defer desugar keepalive arg handling buglet + 2021-03-259f4d5c94b0cmd/go: emit error when listing with -f and -json + 2021-03-25402d784b8fpath/filepath: make Rel handle Windows UNC share + 2021-03-25dec3d00b28cmd/compile/internal/types2: review of stdlib_test.go + 2021-03-25ddcdbb417bcmd/compile/internal/types2: review of assignments.go + 2021-03-25607f99904ecmd/compile/internal/types2: review of api.go + 2021-03-25c69515c9fdcmd/compile/internal/types2: review of expr.go + 2021-03-254889afe8f8cmd/go/internal/load: use setLoadPackageDataError in loadImport + 2021-03-25adb037d67acmd/go: attribute direct imports from indirect dependencies to the importing package + 2021-03-25954879d6d1cmd/go/internal/modload: replace the global buildList with structured requirements + 2021-03-25a95e2ae280test: skip fixedbugs/issue36705 on Windows + 2021-03-2580157b5144crypto/x509: fix spelling error + 2021-03-25e7e0995cbacmd/compile: create/use noder2 transform functions for more node types + 2021-03-2429ed12d4c7testing: update permitted number of -race goroutines + 2021-03-24179bcd787etest: only run bug513.go if cgo is enabled + 2021-03-2463e9f6d5f0test: recognize cgo build tag + 2021-03-24dade83a588cmd/internal/moddeps: fix false positive when $TMPDIR is symlinked + 2021-03-24fef5a15396runtime: bypass ABI wrapper when calling needm on Windows + 2021-03-24771c57e68ecmd/compile: disable shortcircuit optimization for intertwined phi values + 2021-03-24fd5e0bd385cmd/link: mangle function names with ABI on PE + 2021-03-246f62f852efnet/http: fix request cancellation race + 2021-03-240e31de280fmath/big: don't require runtime.(*Frame).Next symbol present + 2021-03-24975b097307cmd/link: separate elf addend size from reloc size + 2021-03-24e8700f1ce6cmd/compile, cmd/link: use weak reference in itab + 2021-03-24747f426944cmd/internal/obj: remove bogus load/store optab entries from ppc64 + 2021-03-24d8960e65a2cmd/go: move psuedo-version and version sorting to x/mod + 2021-03-242e94401277os/exec: use testenv.SkipFlaky in TestExtraFilesFDShuffle + 2021-03-244357f71ca7cmd/compile: remove more dead code and data structures + 2021-03-2414ef2d8c01cmd/compile: fix array case in types-for-register parameter + 2021-03-2387a3ac5f53cmd/compile: don't let -race override explicit -d=checkptr=0 + 2021-03-23769d4b68efcmd/compile: wrap/desugar defer calls for register abi + 2021-03-234e27aa6cd2os/exec: simplify TestContextCancel + 2021-03-23dc289d3dcbio: fix spelling in documentation for io.Discard + 2021-03-232887ef499acmd/compile/internal/test: update abi tests for recent spec changes + 2021-03-23c59b17e5a2cmd/go: make -coverpkg=all skip test-only packages + 2021-03-2305250429aenet/http: treat MaxBytesReader's negative limits as equivalent to zero limit + 2021-03-239b78c68a15cmd/compile: remove AuxCall.results, cleanup ssagen/ssa.go + 2021-03-2353dd0d7809net: make go resolver aware of network parameter + 2021-03-23f4b918384dtest: enable fixedbugs/bug193.go for -G compiler option + 2021-03-23cd26192abago/types: remove superfluous code for shift checking + 2021-03-23e7aa0f9f28go/types, types2: add a test case for shifts that used to fail + 2021-03-238f19394b62cmd/compile/internal/types2: refactor untyped conversions + 2021-03-230265b6475fcmd/compile: replace calls to typecheck with transform functions + 2021-03-23b8371d495bruntime: support long paths without fixup on Windows 10 >= 1607 + 2021-03-23b182ba7fabcmd/compile: optimize codes with arm64 REV16 instruction + 2021-03-23d25476ebb2cmd/internal/obj/arm64: fix constant pool size calculation error + 2021-03-23c819907754cmd/{compile,link}: relocate generation of DWARF for global vars + 2021-03-221c9e587b90net: add IP.IsPrivate + 2021-03-22d9691ffa37cmd/compile/internal/walk: relocate a stray comment + 2021-03-22a93849b9e2cmd/compile: remove now-redundant AuxCall.args + 2021-03-22196c33e92dcmd/compile: fix WriteFuncMap for new ABI. + 2021-03-22ba6b8e75edos/exec: avoid flaky Wait in TestContextCancel + 2021-03-2278afca22c9runtime: fix bogus NtCurrentTeb()->TlsSlots[n] calculation on windows/arm64 + 2021-03-228fd0f83552cmd/compile/internal/ssa: correct sign extension for consts on riscv64 + 2021-03-225437b5a24bcmd/compile: disallow rewrite rules from declaring reserved names + 2021-03-22bd8b3fe5becmd/compile: make no-op rewrite funcs smaller + 2021-03-22e838c76a6ecmd/go/internal/modload: remove go116EnableNarrowAll constant + 2021-03-22d8394bfc7fcmd/internal/obj/arm64: mark functions with small stacks NOSPLIT + 2021-03-20e0fae78e1druntime: fix stack alignment for Windows amd64 lib entry + 2021-03-196ae3b70ef2cmd/compile: add clobberdeadreg mode + 2021-03-199f2a71b6e7make.bash: this change modifies Go to correctly select a dyamic linker + 2021-03-193b0d28808dcmd/go: assume Go 1.16 instead of Go 1.11 for dependencies that lack explicit 'go' directives + 2021-03-191c590661e7testing: allow parallel-subtest goroutines to exit when the subtest is complete + 2021-03-19482903150dsyscall: fix typo in exec_windows_test.go + 2021-03-19836dbdb15bruntime: mark Windows' address-taken asm routines as ABIInternal + 2021-03-194deaa6a178runtime: call nanotimeQPC from nanotime1 without a wrapper + 2021-03-19e58fb90c75net/http: make ExampleGet show StatusCode checks for non-1XX,2XX responses + 2021-03-19a937729c2cnet/http: mention NewRequestWithContext+Client.Do for custom contexts + 2021-03-19196b104bc1cmd/internal/obj/ppc64: consolidate memory classifications + 2021-03-19ed3ae9a340cmd/doc: properly display interface methods + 2021-03-199136d958abcmd/asm: complete the support for VDUP on arm64 + 2021-03-196704843202testing: update helperNames just before checking it + 2021-03-19dcc96e4b94io/ioutil: use correct Go version in redirection comments + 2021-03-1890b1ed1602cmd/compile: get untyped constants working in generic functions + 2021-03-18095ba22597cmd/internal/objabi,runtime: simplify sys.GOEXPERIMENT parsing + 2021-03-180c93b16d01cmd: move experiment flags into objabi.Experiment + 2021-03-18d3ab6b5049test: switch fieldtrack test to use GOEXPERIMENT + 2021-03-18bdbba22404reflect: add tests for reflect.Value.Call for the new ABI + 2021-03-1879d03ad739runtime/pprof: move common code to writeProfileInternal function + 2021-03-18e4253cd023cmd/link: Add section data slice to Archrelocvariant + 2021-03-18b95e4b7850go/types: minor simplification in assignableTo (cleanup) + 2021-03-18f47fab938ecmd/compile: remove unneeded calls to typecheck in noder2 + 2021-03-18eaa1ddee84all: explode GOEXPERIMENT=regabi into 5 sub-experiments + 2021-03-18c71acbfe83test: make nosplit test invariant to ABI wrappers + 2021-03-18af4388aee1cmd/internal/objabi: support boolean GOEXPERIMENTs + 2021-03-186461d74bf2cmd/dist: build bootstrap without GOEXPERIMENT + 2021-03-1806ca809410cmd/internal/objabi: centralize GOEXPERIMENT parsing + 2021-03-18b7cb92ad12cmd/go: remove renameio package and its last usage + 2021-03-18e726e2a608cmd/go: suppress errors for 'go get' of module paths that are also constrained-out packages + 2021-03-186b6ea3271fcmd/go: use the global rooted path name + 2021-03-18db4adb1a9bcmd/link: print symbol versions in stack bound check + 2021-03-189de49ae01acrypto/rsa: correct EncryptOAEP doc comment + 2021-03-18732ea4c2dcsort: add example tests for SearchFloat64s and SearchInts + 2021-03-18c2d625168fcmd/compile,cmd/internal/obj/riscv: load >32-bit constants from memory for riscv64 + 2021-03-1842c25e65f3cmd/compile: actually intrinsify runtime/internal/atomic.{And,Or}{8,} on RISCV64 + 2021-03-186517844129cmd/compile: use a single const MOV operand for riscv64 + 2021-03-18f5e6d3e879cmd/compile: add rewrite rules for conditional instructions on arm64 + 2021-03-1851e4bb236ccmd/compile/internal/types2: delay recording types of untyped operands when checking against type parameters + 2021-03-182583c1b4dfgo/types: add test case for issue #45096 + 2021-03-17f38b6428a2crypto/rand, internal/syscall/unix: add support for getentropy syscall on darwin + 2021-03-17f82ce7fb23cmd/link: improve nonexistent package error message + 2021-03-177e00049b55cmd/go: only add a 'go' directive to the main module when the go.mod file will be written + 2021-03-174313c28861cmd/cgo: check whether C compiler exists + 2021-03-17a5df88355ctime: check int64 overflow in Time.addSec + 2021-03-175423f6023ctest: add bug that failed when run with gccgo + 2021-03-178628bf9a97cmd/compile: resurrect clobberdead mode + 2021-03-170bd308ff27go/parser: avoid formatting a panic message if an assertion succeeds + 2021-03-1770d54df4f6cmd/compile: getting more built-ins to work with generics + 2021-03-172f3db220d1crypto/tls: remove flaky cancellation test + 2021-03-1772b501cb03compress/lzw: add Reset method to Reader and Writer + 2021-03-17119d76d98emath/bits: folded reverse tables by using const string + 2021-03-17a98a0a75b4os/user: make user.LookupGroupId function work for large entries + 2021-03-17a826f7dc45debug/dwarf: support DW_FORM_rnglistx aka formRnglistx + 2021-03-1763b0a0a5b8spec: fix rendering of >= + 2021-03-1768f8e1af29cmd/compile/internal/types2: review of call.go + 2021-03-167a1e963058cmd/compile, cmd/link: dynamically export writable static tmps + 2021-03-16dc1556eaefcmd/compile: update some comments + 2021-03-16c870e86329cmd/asm: when dynamic linking, reject code that uses a clobbered R15 + 2021-03-1672d98df88ecmd/go: bail out from script tests earlier when a timeout occurs + 2021-03-161824667259cmd/compile/internal/ssa: delete unused files + 2021-03-1613a0f7b502spec: clarify that signed integers>=0 are permitted as shift counts + 2021-03-16d206ca5caccmd/compile: fix open defer of method call + 2021-03-160ec2c4abbacmd/compile: (fixed) spill output parameters passed in registers as autos + 2021-03-16832a01aad4cmd/compile: deal with comparable embedded in a constraint + 2021-03-16e31e84010ecmd/asm: add rotr/drotr for mips64 + 2021-03-16bd0fc0b9c3cmd/link: preserve elf phdr flags when loading external objects + 2021-03-16860704317ecrypto/tls: add HandshakeContext method to Conn + 2021-03-160089f8b2f5cmd/go: test that 'go mod tidy' retains upgraded indirect dependencies + 2021-03-16120b9eb1c3cmd/go/internal/modload: in readonly mode, do not read go.mod files missing checksums + 2021-03-1626c32de7c9cmd/go/internal/modcmd: in 'go mod tidy', suspend go.mod writes until tidy + 2021-03-16afe517590ccmd/compile: loads from readonly globals into const for mips64x + 2021-03-16600259b099cmd/compile: use depth first topological sort algorithm for layout + 2021-03-16051bf37833cmd/compile/internal/ssa: handle more cases in fuse pass + 2021-03-1615f16706fbinternal/poll: eliminate the redundant type conversions of FD.Sysfd + 2021-03-1678f9015236runtime: using wyhash for memhashFallback on 32bit platform + 2021-03-16f02a26bed0time: support "," as separator for fractional seconds + 2021-03-15a9b3c4bd06time: add Time.IsDST() to check if its Location is in Daylight Savings Time + 2021-03-15d7cc2f1d7creflect: panic if ArrayOf is called with negative length + 2021-03-15661f3f15d5net: fix BenchmarkWriteToReadFromUDP on Windows + 2021-03-15de2b27dee7all: run gofmt + 2021-03-15e61c9ddb7fRevert "cmd/compile: spill output parameters passed in registers as autos" + 2021-03-158ed438c077cmd/compile: spill output parameters passed in registers as autos + 2021-03-1596aecdcb36cmd/compile: fix case where func-valued field of a generic type is called + 2021-03-15c236095638cmd/compile: add support for generic maps + 2021-03-15dca9c11845cmd/compile: add support for generic channels and type conversion during calls + 2021-03-15bd6aeca968runtime: prepare arenas for use incrementally + 2021-03-15a9cfd55e2bencoding/xml: replace comments inside directives with a space + 2021-03-154d014e7231encoding/xml: handle leading, trailing, or double colons in names + 2021-03-15cc4e6160a7net: use mid-stack inlining with ReadFromUDP to avoid an allocation + 2021-03-152d4042d4aball: update golang.org/x/* dependencies + 2021-03-15a8d9fb2fcdcmd/internal/moddeps: fix typo in TestAllDependencies log messages + 2021-03-15c4190fc34dcmd/compile: remove ARMv5 special case in register allocator + 2021-03-158ac6544564bytes: correct tense in comment + 2021-03-150f4bb9627ecmd/compile: fix outdated comment + 2021-03-157bfe32f39ccmd/internal/obj: reorder ppc64 MOV* optab entries + 2021-03-154350e4961acrypto/md5: improve ppc64x performance + 2021-03-156ccb5c49cccmd/link/internal/ld: fix typo in a comment + 2021-03-14d0d38f0f70cmd/compile: fix whitespace in comment + 2021-03-143cdd5c3bcccmd/link: regression test for issue #42484 + 2021-03-14a8b59fe3cdencoding/json: fix package shadowing in MarshalIndent example + 2021-03-14061a6903a2all: add internal/itoa package + 2021-03-1488b8a16089cmd/cover: replace code using optimized golang.org/x/tools/cover + 2021-03-137936efecc8net/http: revert change from CL 299109 breaking TestAllDependencies + 2021-03-131767d2cc2fio/fs: use testing.T.TempDir in TestWalkDir + 2021-03-134bd4dfe96acmd/compile/internal/ssa: prealloc slice + 2021-03-138336c311f8io: add error check to WriteString Example test + 2021-03-133224990dadfmt: use “truncateString” not “truncate” in method doc + 2021-03-13fedb494878errors/wrap: do not call Elem() twice + 2021-03-13289d34a465all: remove duplicate words + 2021-03-13b3235b75d1encoding/gob: ensure "duplicate type received" decoder errors surface up + 2021-03-1383e79c7b14crypto/ecdsa: fix dead reference link + 2021-03-1359e012991anet/http: note that "HTTP/2" is invalid for ParseHTTPVersion + 2021-03-13a8a85281caruntime: fix documented alignment of 32KiB and 64KiB size classes + 2021-03-138e725f8452all: use HTML5 br tags + 2021-03-1373eb27bd3bmisc/cgo/testcarchive: don't use == for string equality in C code + 2021-03-137588ef0d90cmd/compile/internal/types2: use self_test.go from go/types + 2021-03-1316ad1ea841cmd/compile/internal/types2: simplify error reporting API (cleanup) + 2021-03-137b47f9a5f2cmd/compile: mention that -m can be increased or given multiple times + 2021-03-123eebc26700delete favicon.ico and robots.txt + 2021-03-1286bbf4beeecmd/go: fix godoc formatting for text from 'go help install' + 2021-03-1278052f4c4ecmd/compile: minor cleanup -- remove dead code conditional on test + 2021-03-127240a18adbcmd/compile: test register ABI for method, interface, closure calls + 2021-03-12cdd08e615acmd/go/internal/load: always set IsImportCycle when in a cycle + 2021-03-124662029264runtime: simplify divmagic for span calculations + 2021-03-12735647d92eruntime: add alignment info to sizeclasses.go comments + 2021-03-12086357e8f6cmd/go: include default GOEXPERIMENT in build config + 2021-03-129289c12002Revert "testing/fstest: test that ReadDirFile on a non-dir fails" + 2021-03-12e8b82789cdA+C: add new e-mail addresses for Andy Pan + 2021-03-12e87c4bb3efcmd/compile: fix noder.Addr() to not call typechecker + 2021-03-1271330963c0internal/poll: fix some grammar errors + 2021-03-12a607408403cmd/internal/obj/arm64: add support for op(extended register) with RSP arguments + 2021-03-1271a6c13164cmd/compile: call types.CheckSize() in g.typ() + 2021-03-117fc638d6f1cmd: move GOEXPERIMENT knob from make.bash to cmd/go + 2021-03-11b3896fc331net/http: revert change to generated file from CL 296152 + 2021-03-114dd9c7cadccmd/go: remove some fsyncs when writing files + 2021-03-1143d5f213e2cmd/compile: optimize multi-register shifts on amd64 + 2021-03-11b0733ba12dhash/maphash: increase the buffer size + 2021-03-1164d323f45ahash/maphash: optimize Write and WriteString + 2021-03-11ae9cd1299chash/maphash: manually inline setSeed + 2021-03-1186d6678429testing/fstest: clarify TestFS docs + 2021-03-111853411d83testing/fstest: test that ReadDirFile on a non-dir fails + 2021-03-11bbf79793bdio/fs: clarify additional File interface docs + 2021-03-110a655598e1cmd/link: fix glink resolver generation on ppc64le + 2021-03-11f009b5b226runtime: support register ABI for finalizers + 2021-03-11415ca3f1f0test: add test that caused a gofrontend internal error + 2021-03-110fc370c5d2docs: clarify when APIs use context.Background. + 2021-03-11b8e9ec856csyscall: use runtime.KeepAlive for ProcThreadAttributeList arguments + 2021-03-119ece63f064crypto/rand, internal/syscall/unix: add support for getrandom syscall on solaris + 2021-03-1179e3ee52f4internal/syscall/unix: unify GetRandom implementation + 2021-03-113a3b8164fdcmd/dist: refactor test constraints for misc/cgo/testsantizers + 2021-03-1168f3344fe9cmd/compile: remove 8-byte alignment requirement of stack slot on ppc64 + 2021-03-11fdded79e6ecmd/compile: fix handling of partially inferred type arguments + 2021-03-101bad3831a0cmd/internal/obj: remove param element from ppc64 optab + 2021-03-10aa26687e45runtime, time: disable preemption in addtimer + 2021-03-10f9ed8b3f1ecmd/go/internal/mvs: factor out an incremental implementation + 2021-03-102ceb79db52cmd/go/internal/modload: make EditBuildList report whether the build list was changed + 2021-03-10b7f0fb6d9ecmd/go/internal/modload: fuse upgrading with downgrading in EditBuildList + 2021-03-10a1a3d33b0dcmd/go: test remote lookup of packages with leading dots in path elements + 2021-03-10ccf9acefa8cmd/compile/internal: improve handling of DS form offsets on ppc64x + 2021-03-10c41bf9ee81runtime: check partial lock ranking order + 2021-03-105ce51ea741flag: panic if flag name begins with - or contains = + 2021-03-10d0b79e3513encoding/xml: prevent infinite loop while decoding + 2021-03-10cd3b4ca9f2archive/zip: fix panic in Reader.Open + 2021-03-101811aeae66cmd/compile: deal with helper generic types that add methods to T + 2021-03-105edab39f49cmd/gofmt: fix const association to avoid inaccurate comment + 2021-03-10489231111fgo/types: add missing build tag to api_go1.18_test.go + 2021-03-107457462303runtime/race: update dead link + 2021-03-10818f6b14b4cmd/compile: remove ".fp" fake arg + 2021-03-10bc489dd6d5runtime: update signature of reflectcall functions + 2021-03-1030c28bbf05cmd/go: avoid password prompts in TestScript/mod_get_private_vcs + 2021-03-10cf59850466crypto/rand: supports for getrandom syscall in DragonFlyBSD + 2021-03-104d608eb224testing: fix typo in a comment + 2021-03-10643d240a11internal/poll: implement a pipe pool for splice() call + 2021-03-10d33e2192a7cmd/go: allow '+' in package import paths in module mode + 2021-03-1041245ab283cmd/compile/internal/types2: remove concept of finals + 2021-03-10acd7cb5887cmd/compile/internal/types2: better error reporting framework (starting point) + 2021-03-09142a76530cgo/types: improve the positioning of broken import errors + 2021-03-0948ddf70128cmd/asm,cmd/compile: support 5 operand RLWNM/RLWMI on ppc64 + 2021-03-0918510ae88fruntime, cmd/link/internal/ld: disable memory profiling when data unreachable + 2021-03-09e4f3cfadf6net: don't append a dot to TXT records on Plan 9 + 2021-03-09382851c1fdcmd/compile: fix failure to communicate between ABIinfo producer&consumer + 2021-03-099f5298ca6ecmd/compile: fix confusion in generating SelectN index + 2021-03-0998dfdc82c8cmd/compile: fix broken type+offset calc for register args + 2021-03-095eb9912084cmd/compile: fix OpArg decomposer for registers in expandCalls + 2021-03-0948895d021bcmd/compile: remove skipping of implicit operations during export + 2021-03-09b6df58bd1fcmd/compile: detect duplicate importing earlier + 2021-03-09e8e425cb23runtime: add pollDesc partial edges + 2021-03-09b60a3a8cfbcmd/compile: add debugging mode for import/export + 2021-03-09a70eb2c9f2cmd/compile: get instantiated generic types working with interfaces + 2021-03-09034fffdb49net: use io.Discard in TestSendfileOnWriteTimeoutExceeded + 2021-03-09762ef81a56cmd/link/internal/ld: deflake TestWindowsIssue36495 + 2021-03-09b70a2bc9c6cmd/compile: make ValAndOff.{Val,Off} return an int32 + 2021-03-09437d229e2aruntime: document netpollclose + 2021-03-09618b66e16dcmd/compile: remove 4-byte alignment requirement of stack slot on arm + 2021-03-08b6def6a34ecmd/vet: bring in sigchanyzer to report unbuffered channels to signal.Notify + 2021-03-08a08adda12cos/signal: remove comments about SA_RESTART + 2021-03-08bd37284784cmd/link: use testing.T.TempDir in tests + 2021-03-08fee3cd4250cmd/compile: fix width not calculated for imported type + 2021-03-087419a86c82cmd/link/internal/ld: fix typo in a comment + 2021-03-08b4787201c9cmd/compile: minor doc improvements + 2021-03-08aafad20b61encoding/binary: limit bytes read by Uvarint to <= 10 + 2021-03-08125eca0f72cmd/compile: improve IsNonNil rule on riscv64 + 2021-03-07597b5d192ecmd/compile: rename internal-abi.md to abi-internal.md + 2021-03-07b0df92703cmath/big: add shrVU and shlVU benchmarks + 2021-03-05414fa8c35ecmd/internal/objabi: use a separate bit to mark weak relocation + 2021-03-05009bfeae86reflect: add VisibleFields function + 2021-03-05f901ea701dcmd/internal/goobj: store relocation type as uint16 + 2021-03-0587d29939c8runtime: remove racefuncenterfp + 2021-03-057205a4fbdccmd/internal/goobj: regenerate builtin list + 2021-03-05fb03be9d55cmd/compile: use getcallersp for gorecover "fp" arg + 2021-03-05a22bd3dc73cmd/compile: use getcallerpc for racefuncentry + 2021-03-05a829114b21cmd/compile: match Aux and AuxInt explicitly in store combining rule + 2021-03-05d85083911druntime: encapsulate access to allgs + 2021-03-0539bdd41d03cmd/go/internal/modfetch/codehost: report git errors more accurately + 2021-03-0544721f4565test: enable "-d=panic" by default for errorcheck* + 2021-03-05c082f9fee0cmd/compile: do not set ONAME type when evaluated in type context + 2021-03-05fbee173545cmd/compile: fix wrong condition in tcShift + 2021-03-059e6b1fcd0acmd/compile: do not report error for invalid constant + 2021-03-0551d8d351c1cmd/compile: do not set type for OTYPESW + 2021-03-0580098ef00ccmd/compile: don't expand invalid embedded interface + 2021-03-0570b277cf2ecmd/compile: only check return for valid functions + 2021-03-05d4247f5167text/template: wrap errors returned by template functions instead of stringifying them + 2021-03-0567b9ecb23bruntime: update paniclk ordering + 2021-03-05280c735b07cmd/go: require a module root in 'go list -m' with an unversioned path + 2021-03-05a2f7067233reflect: include the alignment of zero-sized types in stack offsets + 2021-03-05c5a1c2276ereflect: use global variables for register count + 2021-03-05302a400316cmd/go/internal/modfetch: detect and recover from missing ziphash file + 2021-03-052e794c2bb1testing: add TB.Setenv + 2021-03-052217e89ba3net/http/httptrace: fix doc typo + 2021-03-0531df4e3fcdcmd/link: add relocs type for mips64x + 2021-03-0560b500dc6cmath/big: remove bounds checks for shrVU_g inner loop + 2021-03-05f0b6d3753fcmd/go: update PWD variable for 'go generate' + 2021-03-052b0e29f516docs: fix case of GitHub + 2021-03-05b62da08909cmd/go: update error expectations in TestScript/mod_install_pkg_version + 2021-03-05a7526bbf72encoding/json: marshal maps using reflect.Value.MapRange + 2021-03-0496a96a9058cmd/compile: remove types2.(*Selection).TArgs(), now that instance bug seems fixed + 2021-03-04d891ebdce1cmd/compile: return (and receive) medium-large results + 2021-03-04d6504b8097cmd/compile: tweak offset-generator to elide more +0 offsets + 2021-03-045c5552c5bacmd/compile: add register abi tests + 2021-03-0456d52e6611cmd/go: don't report missing std import errors for tidy and vendor + 2021-03-04b87e9b9f68cmd/go: clarify errors for commands run outside a module + 2021-03-04a99ff24a26cmd/compile/internal/syntax: print type parameters and type lists + 2021-03-049d3718e834cmd/compile: remove I-saw-a-register-pragma chatter + 2021-03-04c015f76acbcmd/compile: implement too-big-to-SSA struct passing in registers + 2021-03-0477505c25d8syscall: treat proc thread attribute lists as unsafe.Pointers + 2021-03-049d88a9e2bfcmd/compile: implement simple register results + 2021-03-042d30c94874cmd/internal: Add 6 args to ppc64 optab + 2021-03-04cfb609bfb7cmd/go: ensure that the test subprocess always times out in TestScript/test_write_profiles_on_timeout + 2021-03-049c54f878d2runtime: remove GODEBUG=scavenge mode + 2021-03-049a40dee3eecmd/go: reject 'go list -m MOD@patch' when no existing version of MOD is required + 2021-03-04a416efef5aruntime: remove a duplicated testcase of TestPallocDataFindScavengeCa… + 2021-03-043778f8e07dcmd/compile: fix pointer maps for morestack + 2021-03-04a2d92b5143cmd/compile: register abi, morestack work and mole whacking + 2021-03-04868a110c56cmd/compile: make check2 gracefully exit if it reported errors + 2021-03-041d0256a989cmd/compile: do not add invalid key to constSet + 2021-03-044b8b2c5864cmd/compile: do not set type for OTYPE + 2021-03-048c22874e4ecmd/compile: skip diag error in checkassign if one was emitted + 2021-03-0412a405b96acmd/compile: do not set type for OPACK + 2021-03-04b7f4307761cmd/compile: graceful handle error in noder LoadPackage + 2021-03-044532467c18cmd/compile: pass register parameters to called function + 2021-03-0495ff296a11cmd/compile: pass arguments as register parameters to StaticCall. + 2021-03-0404a4dca2accmd/compile: refactor out an almost-superfluous arg + 2021-03-04775f11cda1cmd/internal/obj/arm64: remove unncessary class check in addpool + 2021-03-0427dbc4551acmd/asm: disable scaled register format for arm64 + 2021-03-04593f5bbad7cmd/compile: adjust stack slot alignment requirements on arm64 + 2021-03-04355c3a037ecmd/internal/obj/asm64: add support for moving BITCON to RSP + 2021-03-04726d704c32cmd/asm: add arm64 instructions VUMAX and VUMIN + 2021-03-0479beddc773cmd/asm: add 128-bit FLDPQ and FSTPQ instructions for arm64 + 2021-03-0412bb256cb3go/types: use correct recv for parameterized embedded methods + 2021-03-036db80d7420cmd/compile/internal/types2: use correct recv for parameterized embedded methods + 2021-03-03d6f6ef6358cmd/compile: remove races introduced in abiutils field update + 2021-03-033e524ee65acmd/compile: make modified Aux type for OpArgXXXX pass ssa/check + 2021-03-039f33dc3ca1cmd/compile: handle aggregate OpArg in registers + 2021-03-03c4e3f6c4c7cmd/compile: remove 8-byte alignment requirement of stack slot on s390x + 2021-03-0385f62b0941cmd/compile: remove 8-byte alignment requirement of stack slot on mips + 2021-03-03497feff168cmd/compile: intrinsify runtime/internal/atomic.{And,Or}{8,} on RISCV64 + 2021-03-0300cb841b83syscall: implement rawVforkSyscall for remaining linux platforms + 2021-03-03f2df1e3c34cmd/compile: retrieve Args from registers + 2021-03-0306c72f3627A+C: change email address for Baokun Lee + 2021-03-0384ca4949a7cmd/compile: remove 8-byte alignment requirement of stack slot on mips64 + 2021-03-0377973863c3cmd/compile: use abiutils for all rcvr/in/out frame offsets. + 2021-03-03aea1259a72cmd/link: disable flaky Darwin "symbols" test + 2021-03-02312fd9937dcmd/go: remove -insecure flag on go get + 2021-03-022a2f99eefbcmd/go/internal/modload: do not resolve an arbitrary version for 'go list --versions' + 2021-03-02b65091c11dcmd/go: add a test case that reproduces #44296 + 2021-03-02e9eed78dc3cmd/go: resolve std-vendored dependencies as std packages except in 'go get' and 'go mod' + 2021-03-0209f4ef4fa7cmd/go/internal/mvs: prune spurious dependencies in Downgrade + 2021-03-02c6374f5162dist: generate stub go.mod in workdir + 2021-03-0297b32a6724cmd/compile: better version of check frame offsets against abi + 2021-03-022b50ab2aeecmd/compile: optimize single-precision floating point square root + 2021-03-02ebb92dfed9internal/poll, runtime: handle netpollopen error in poll_runtime_pollOpen + 2021-03-024c1a7ab49ccmd/go: reject relative paths in GOMODCACHE environment + 2021-03-02580636a78aall: fix spelling + 2021-03-02a6eeb4add4go/parser,go/types: hide API changes related to type parameters + 2021-03-02ff5cf4ced3cmd/link,debug/elf: mips32, add .gnu.attributes and .MIPS.abiflags sections + 2021-03-01700b73975eruntime: use entersyscall in syscall_syscallX on Darwin + 2021-03-01a69c45213dgo/types: review of expr.go + 2021-03-01b98ce3b606cmd/compile: import empty closure function correctly + 2021-03-0197bdac03aecmd: upgrade golang.org/x/mod to relax import path check + 2021-03-01f6a74c6568cmd/compile/internal/ir: fix up stale comment + 2021-03-0187beecd6dfcmd/go: add missing newline to retraction warning message + 2021-03-01a400eb3261Revert "cmd/compile: check frame offsets against abi" + 2021-03-015fafc0bbd4cmd/go/internal/modload: don't query when fixing canonical versions + 2021-03-012a8df4488eos: mark pipes returned by os.Pipe() as inheritable by default + 2021-02-275ff7ec98b7cmd/compile: check frame offsets against abi + 2021-02-27a429926159cmd/compile: fix escape analysis of heap-allocated results + 2021-02-27998fe70b68cmd/compile: fixed which-result confusion in presence of 0-width types + 2021-02-27d9fd38e68btime: correct unusual extension string cases + 2021-02-26cda8ee095ereflect: fix register ABI spill space calculation + 2021-02-26d8e33d558ecmd/compile: deal with closures in generic functions and instantiated function values + 2021-02-2619f96e73bfsyscall: introduce SysProcAttr.ParentProcess on Windows + 2021-02-263146166baasyscall: introduce SysProcAttr.AdditionalInheritedHandles on Windows + 2021-02-262d760816ffsyscall: restrict inherited handles on Windows + 2021-02-26ba9168bd07syscall: add support for proc thread attribute lists + 2021-02-26f41460145ecmd/link: recognize ARM64 PE files and relocations + 2021-02-26a655208c9ecmd/link: handle types as converted to interface when dynlink + 2021-02-2623943a6737cmd/compile: fix mishandling of unsafe-uintptr arguments with call method in go/defer + 2021-02-26e25040d162cmd/compile: change StaticCall to return a "Results" + 2021-02-269a555fc24ccmd/compile: fix missing descend in Addrtaken for closures. + 2021-02-25a61524d103cmd/internal/obj: add Prog.SetFrom3{Reg,Const} + 2021-02-255f15af111csyscall: comment on fields omitted from the win32finddata1 struct + 2021-02-259a7fe196e4Revert "cmd/compile: fix mishandling of unsafe-uintptr arguments with call method in go/defer" + 2021-02-25b83d073e9ereflect: add Method.IsExported and StructField.IsExported methods + 2021-02-257fcf9893f7cmd/internal/obj: fix typo in docs + 2021-02-256c3bcda866cmd/compile: declare inlined result params early for empty returns + 2021-02-25526ee96f49os: avoid allocation in File.WriteString + 2021-02-25194b636f8fdatabase/sql: close driver.Connector if it implements io.Closer + 2021-02-254ebb6f5110cmd/compile: automate resultInArg0 register checks + 2021-02-251a3e968b1fcmd/compile: fix mishandling of unsafe-uintptr arguments with call method in go/defer + 2021-02-25ee2a45e5fbruntime: use pipe2 for nonblockingPipe on dragonfly + 2021-02-251f7a01459bruntime: batch moving gFree list between local p and global schedt + 2021-02-25bcac57f89ccmd: upgrade golang.org/x/mod to fix go.mod parser + 2021-02-253137da82fdcmd/go: add a script test corresponding to the downhiddenartifact MVS test + 2021-02-252c4c189bbacmd/go/internal/mvs: add test cases for downgrade interaction with hidden versions + 2021-02-259fe8ebf9b4test: add test case that failed with gccgo + 2021-02-25ad17b65b34testing/fstest: treat dash specially when building glob + 2021-02-2537ca84a9cdsyscall: return error if GetQueuedCompletionStatus truncates key + 2021-02-2576c0003cd5syscall, os: use pipe2 syscall on DragonflyBSD instead of pipe + 2021-02-25666ad85df4cmd/compile: fix typo in rewrite_test.go + 2021-02-25d822ffebc5test: fix inline.go test for linux-amd64-noopt + 2021-02-25ff614b13d9runtime: subtract one from ip when determining abort + 2021-02-24dbbc5ec7e8syscall: restore broken GetQueuedCompletionStatus signature but make it not crash + 2021-02-24d0d21b7c4ccmd/compile: plumb abi info into expandCalls + 2021-02-248027343b63cmd/compile: disable inlining functions with closures for now + 2021-02-246c3f8a2f47cmd/link: use ctxt.Logf instead of package log + 2021-02-243ee32439b5cmd/compile: ARM64 optimize []float64 and []float32 access + 2021-02-2480ddc17ae1cmd/compile/internal-abi: fix ABI0-equivalence for zero-sized values + 2021-02-243deb528199cmd/compile/internal-abi: update internal ABI spec for g register + 2021-02-24478277f812cmd/compile/internal-abi: use x87 mode, not MMX mode + 2021-02-24bf48163e8fcmd/compile: add rule to coalesce writes + 2021-02-24b7f62daa59cmd/internal/goobj: add test case for object file reader + 2021-02-24c9d9b40b13context: avoid importing context package twice + 2021-02-24dc4698f52bsyscall: do not overflow key memory in GetQueuedCompletionStatus + 2021-02-247a2f3273c5cmd/compile: plumb abi info into ssagen/ssa + 2021-02-24adb467ffd2cmd/compile: reduce inline cost of OCONVOP + 2021-02-2427684ea195testing: print late arriving log line in panic + 2021-02-24ae1fa08e41context: reduce contention in cancelCtx.Done + 2021-02-24691ac806d2cmd/go: fix version validation in 'go mod edit -exclude' + 2021-02-24b97b1456aecmd/go, cmd/cgo: pass -mfp32 and -mhard/soft-float to MIPS GCC + 2021-02-2407c658316bio/ioutil: forward TempFile and TempDir to os package + 2021-02-2404edf418d2encoding/json: reduce allocated space in Unmarshal + 2021-02-24e496120891database: remove race in TestTxContextWait + 2021-02-2426001d109ego/types: review of call.go + 2021-02-2435b80eac7dhash/maphash: remove duplicate from Hash documentation + 2021-02-24eb863240dcruntime: remove unused const stackSystem on dragonfly + 2021-02-24084b07d6f6spec: improve sentence structure for passing a slice + 2021-02-246ba4a300d8docs: fix spelling + 2021-02-2443652dc46fbufio, bytes, strings: handle negative runes in WriteRune + 2021-02-243780529255unicode: correctly handle negative runes + 2021-02-240694fb3d78image: resolve the TODO of doc comment style + 2021-02-236cc8aa7ecego/types: minor updates to comments to align with types2 + 2021-02-2342b9e3a8dfcontext: fix XTestInterlockedCancels + 2021-02-23aaed6cbcedtesting/race: fixing intermittent test failure + 2021-02-23fbed561f8aruntime: reset stack poison flag accidentally set + 2021-02-230458d8c983go/types, types2: constraints may be parenthesized and that includes "any" + 2021-02-2374903553bcdoc: start draft go1.17 release notes, move go1.16 to x/website + 2021-02-23fa40c0232ccmd/go: reproduce issue #44497 in TestScript/mod_edit + 2021-02-23a4dac8bd22runtime: use BX instead of R15 in race detector + 2021-02-23c49c7a675aruntime: save R15 before checking AVX state + 2021-02-23d2911d7612cmd/compile: fold MOV*nop and MOV*const + 2021-02-23d434c2338bruntime: clarify GC fractional mode description + 2021-02-23a671e33c6dall: use more precise build tags + 2021-02-23c584f42dcfcmd/compile: change riscv64 Eq32/Neq32 to zero extend before subtraction + 2021-02-23080119799bruntime: fix usleep on windows/arm + 2021-02-2374cac8d479cmd/compile: add AMD64 parameter register defs, Arg ops, plumb to ssa.Config + 2021-02-2342cd40ee74cmd/compile: improve bit test code + 2021-02-23f1562c7610cmd/go: recognize DLL magic from llvm binaries + 2021-02-23bf5fa2d198cmd/compile: guard special register usage with GOEXPERIMENT=regabi + 2021-02-23c7f596f919cmd/go: resolve TODO by replacing InDir() function + 2021-02-235e94fe9316go/build/constraint: fix splitPlusBuild func doc comment + 2021-02-2355d7dcc3cdruntime: optimize the memory padding in p struct + 2021-02-23ab331c0254runtime/cgo: use correct lean and mean macro + 2021-02-2391cfbf39e4cmd/link: set .ctors COFF section to writable and aligned + 2021-02-23811167e2c9cmd/link: do not pass -Bsymbolic for PE DLLs + 2021-02-23a51daac840cmd/link: set SizeOfRawData rather than VirtualSize in COFF files for .bss section + 2021-02-23e5159b2a2fcmd/internal/dwarf: minor cleanups + 2021-02-23b3b65f2176runtime: enable race detector on openbsd/amd64 + 2021-02-23a78b0e6721internal/poll: fix the verbose condition in splice + 2021-02-2308543f0715ios/fs: mention f.dir in (*subFS).fixErr godoc + 2021-02-230398a771d2cmd/internal/obj/riscv: prevent constant loads that do not target registers + 2021-02-236525abddcecmd/internal/obj/riscv: clean up branch tests + 2021-02-23c4b771348cruntime: fix windows/arm signal handling assembly + 2021-02-232a18e37c4ecmd/compile: remove backend's "scratch mem" support + 2021-02-23e52149822bcmd/compile: simplify assert{E,I}2I{,2} calling conventions + 2021-02-2386deb459decmd/compile: remove selectnbrecv2 + 2021-02-234048491234cmd/compile,runtime: make selectnbrecv return two values + 2021-02-235e804ba17dcmd/compile: use transitive relations for slice len/cap in poset + 2021-02-236a40dd05d8cmd/compile/internal/types2: review of sanitize.go + 2021-02-23975ba6e2b2cmd/compile: mark OpSB, OpSP as poor statement Op + 2021-02-23a2e150c7cdgo/types, cmd/compile/internal/types2: use regular type printing for unsafe.Pointer + 2021-02-235a0e4fc4e7cmd/compile/internal/types2: review of conversions.go + 2021-02-2389eb2b55b9cmd/compile/internal/types2: review of issues_test.go + 2021-02-23378f73e2d5cmd/compile/internal/types2: enable TestIssue25627 + 2021-02-231901e2647ftest: add test for findTypeLoop with symbols from other packages + 2021-02-235f3dabbb79cmd/compile: fix import of functions of multiple nested closure + 2021-02-237af821a661all: faster midpoint computation in binary search + 2021-02-23f113e9a14fcmd/dist: match goexperiment.regabi tag when GOEXPERIMENT is on + 2021-02-221126bbb82ago/parser: return ast.BadExpr for missing index operands + 2021-02-221678829d95cmd/compile: correctly use X15 to zero frame + 2021-02-22094048b938cmd/compile/internal: loop opt + 2021-02-221391d4142cfix typo in issue16760.go + 2021-02-2204903476fecmd/compile: reject some rare looping CFGs in shortcircuit + 2021-02-2287e984ab29test: add test for issue 38698 + 2021-02-22b2bdadfe88cmd/internal: cleanup ppc64 optab structure + 2021-02-210f66fb7b85go/internal/gccgoimporter: fix up gccgo installation test + 2021-02-21e78e04ce39cmd/compile: fix panic in DWARF-gen handling obfuscated code + 2021-02-2003d36d8198syscall: add explicit ios build tag + 2021-02-2040656f3a75doc/1.16: fix link to fs.FileInfo + 2021-02-20d4b2638234all: go fmt std cmd (but revert vendor) + 2021-02-200625460f79cmd/vet: update buildtag check for //go:build lines + 2021-02-209fd6cc105dgo/printer: canonicalize //go:build and // +build lines while formatting + 2021-02-205b76343a10go/build: prefer //go:build over // +build lines + 2021-02-20a8942d2cffruntime/pprof: disable TestMorestack on darwin/arm64 + 2021-02-20078f08f0eespec: every type has a method set (minor clarification) + 2021-02-1926713b5fefgo/types: don't write during sanitizeInfo if nothing has changed + 2021-02-199a99515c8fall: REVERSE MERGE dev.typeparams (7cdfa49) into master Change-Id: I4cf2fdc409e7028ff505042c33672f74755a97ed
This commit is contained in:
commit
d2b3efcb90
3255 changed files with 122615 additions and 56510 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -37,6 +37,7 @@ _testmain.go
|
|||
/src/cmd/internal/objabi/zbootstrap.go
|
||||
/src/go/build/zcgo.go
|
||||
/src/go/doc/headscan
|
||||
/src/internal/buildcfg/zbootstrap.go
|
||||
/src/runtime/internal/sys/zversion.go
|
||||
/src/unicode/maketables
|
||||
/test.out
|
||||
|
|
|
|||
5
AUTHORS
5
AUTHORS
|
|
@ -145,7 +145,7 @@ Andy Davis <andy@bigandian.com>
|
|||
Andy Finkenstadt <afinkenstadt@zynga.com>
|
||||
Andy Lindeman <andy@lindeman.io>
|
||||
Andy Maloney <asmaloney@gmail.com>
|
||||
Andy Pan <panjf2000@gmail.com>
|
||||
Andy Pan <panjf2000@gmail.com> <panjf2000@golangcn.org> <i@andypan.me>
|
||||
Andy Walker <walkeraj@gmail.com>
|
||||
Anfernee Yongkun Gui <anfernee.gui@gmail.com>
|
||||
Angelo Bulfone <mbulfone@gmail.com>
|
||||
|
|
@ -195,7 +195,7 @@ Ayanamist Yang <ayanamist@gmail.com>
|
|||
Aymerick Jéhanne <aymerick@jehanne.org>
|
||||
Azat Kaumov <kaumov.a.r@gmail.com>
|
||||
Baiju Muthukadan <baiju.m.mail@gmail.com>
|
||||
Baokun Lee <nototon@gmail.com>
|
||||
Baokun Lee <nototon@gmail.com> <bk@golangcn.org>
|
||||
Bartosz Grzybowski <melkorm@gmail.com>
|
||||
Bastian Ike <bastian.ike@gmail.com>
|
||||
Ben Burkert <ben@benburkert.com>
|
||||
|
|
@ -1425,6 +1425,7 @@ Wèi Cōngruì <crvv.mail@gmail.com>
|
|||
Wei Fu <fhfuwei@163.com>
|
||||
Wei Guangjing <vcc.163@gmail.com>
|
||||
Weichao Tang <tevic.tt@gmail.com>
|
||||
Weixie Cui <cuiweixie@gmail.com> <523516579@qq.com>
|
||||
Wembley G. Leach, Jr <wembley.gl@gmail.com>
|
||||
Will Faught <will.faught@gmail.com>
|
||||
Will Storey <will@summercat.com>
|
||||
|
|
|
|||
|
|
@ -240,7 +240,7 @@ Andy Davis <andy@bigandian.com>
|
|||
Andy Finkenstadt <afinkenstadt@zynga.com>
|
||||
Andy Lindeman <andy@lindeman.io>
|
||||
Andy Maloney <asmaloney@gmail.com>
|
||||
Andy Pan <panjf2000@gmail.com>
|
||||
Andy Pan <panjf2000@gmail.com> <panjf2000@golangcn.org> <i@andypan.me>
|
||||
Andy Walker <walkeraj@gmail.com>
|
||||
Andy Wang <cbeuw.andy@gmail.com>
|
||||
Andy Williams <andy@andy.xyz>
|
||||
|
|
@ -321,7 +321,7 @@ Azat Kaumov <kaumov.a.r@gmail.com>
|
|||
Baiju Muthukadan <baiju.m.mail@gmail.com>
|
||||
Balaram Makam <bmakam.qdt@qualcommdatacenter.com>
|
||||
Balazs Lecz <leczb@google.com>
|
||||
Baokun Lee <nototon@gmail.com>
|
||||
Baokun Lee <nototon@gmail.com> <bk@golangcn.org>
|
||||
Barnaby Keene <accounts@southcla.ws>
|
||||
Bartosz Grzybowski <melkorm@gmail.com>
|
||||
Bartosz Oler <brtsz@google.com>
|
||||
|
|
@ -466,7 +466,7 @@ Charlotte Brandhorst-Satzkorn <catzkorn@gmail.com>
|
|||
Chauncy Cullitan <chauncyc@google.com>
|
||||
Chen Zhidong <njutczd@gmail.com>
|
||||
Chen Zhihan <energiehund@gmail.com>
|
||||
Cherry Zhang <cherryyz@google.com>
|
||||
Cherry Mui <cherryyz@google.com>
|
||||
Chew Choon Keat <choonkeat@gmail.com>
|
||||
Chiawen Chen <golopot@gmail.com>
|
||||
Chirag Sukhala <cchirag77@gmail.com>
|
||||
|
|
@ -2526,6 +2526,7 @@ Wei Guangjing <vcc.163@gmail.com>
|
|||
Wei Xiao <wei.xiao@arm.com>
|
||||
Wei Xikai <xykwei@gmail.com>
|
||||
Weichao Tang <tevic.tt@gmail.com>
|
||||
Weixie Cui <cuiweixie@gmail.com> <523516579@qq.com>
|
||||
Wembley G. Leach, Jr <wembley.gl@gmail.com>
|
||||
Wenlei (Frank) He <wlhe@google.com>
|
||||
Wenzel Lowe <lowewenzel@gmail.com>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
pkg encoding/json, method (*RawMessage) MarshalJSON() ([]uint8, error)
|
||||
pkg math, const MaxFloat64 = 1.79769e+308 // 179769313486231570814527423731704356798100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
pkg math, const SmallestNonzeroFloat32 = 1.4013e-45 // 17516230804060213386546619791123951641/12500000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
pkg math, const SmallestNonzeroFloat64 = 4.94066e-324 // 4940656458412465441765687928682213723651/1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
pkg math/big, const MaxBase = 36
|
||||
pkg math/big, type Word uintptr
|
||||
pkg net, func ListenUnixgram(string, *UnixAddr) (*UDPConn, error)
|
||||
|
|
|
|||
99
api/next.txt
99
api/next.txt
|
|
@ -0,0 +1,99 @@
|
|||
pkg compress/lzw, method (*Reader) Close() error
|
||||
pkg compress/lzw, method (*Reader) Read([]uint8) (int, error)
|
||||
pkg compress/lzw, method (*Reader) Reset(io.Reader, Order, int)
|
||||
pkg compress/lzw, method (*Writer) Close() error
|
||||
pkg compress/lzw, method (*Writer) Reset(io.Writer, Order, int)
|
||||
pkg compress/lzw, method (*Writer) Write([]uint8) (int, error)
|
||||
pkg compress/lzw, type Reader struct
|
||||
pkg compress/lzw, type Writer struct
|
||||
pkg crypto/tls, method (*CertificateRequestInfo) Context() context.Context
|
||||
pkg crypto/tls, method (*ClientHelloInfo) Context() context.Context
|
||||
pkg crypto/tls, method (*Conn) HandshakeContext(context.Context) error
|
||||
pkg debug/elf, const SHT_MIPS_ABIFLAGS = 1879048234
|
||||
pkg debug/elf, const SHT_MIPS_ABIFLAGS SectionType
|
||||
pkg encoding/csv, method (*Reader) FieldPos(int) (int, int)
|
||||
pkg go/ast, method (*FuncDecl) IsMethod() bool
|
||||
pkg go/build, type Context struct, ToolTags []string
|
||||
pkg go/parser, const SkipObjectResolution = 64
|
||||
pkg go/parser, const SkipObjectResolution Mode
|
||||
pkg go/types, type Config struct, GoVersion string
|
||||
pkg io/fs, func FileInfoToDirEntry(FileInfo) DirEntry
|
||||
pkg net, method (*ParseError) Temporary() bool
|
||||
pkg net, method (*ParseError) Timeout() bool
|
||||
pkg net, method (IP) IsPrivate() bool
|
||||
pkg reflect, func VisibleFields(Type) []StructField
|
||||
pkg reflect, method (Method) IsExported() bool
|
||||
pkg reflect, method (StructField) IsExported() bool
|
||||
pkg runtime/cgo (darwin-amd64-cgo), func NewHandle(interface{}) Handle
|
||||
pkg runtime/cgo (darwin-amd64-cgo), method (Handle) Delete()
|
||||
pkg runtime/cgo (darwin-amd64-cgo), method (Handle) Value() interface{}
|
||||
pkg runtime/cgo (darwin-amd64-cgo), type Handle uintptr
|
||||
pkg runtime/cgo (freebsd-386-cgo), func NewHandle(interface{}) Handle
|
||||
pkg runtime/cgo (freebsd-386-cgo), method (Handle) Delete()
|
||||
pkg runtime/cgo (freebsd-386-cgo), method (Handle) Value() interface{}
|
||||
pkg runtime/cgo (freebsd-386-cgo), type Handle uintptr
|
||||
pkg runtime/cgo (freebsd-amd64-cgo), func NewHandle(interface{}) Handle
|
||||
pkg runtime/cgo (freebsd-amd64-cgo), method (Handle) Delete()
|
||||
pkg runtime/cgo (freebsd-amd64-cgo), method (Handle) Value() interface{}
|
||||
pkg runtime/cgo (freebsd-amd64-cgo), type Handle uintptr
|
||||
pkg runtime/cgo (freebsd-arm-cgo), func NewHandle(interface{}) Handle
|
||||
pkg runtime/cgo (freebsd-arm-cgo), method (Handle) Delete()
|
||||
pkg runtime/cgo (freebsd-arm-cgo), method (Handle) Value() interface{}
|
||||
pkg runtime/cgo (freebsd-arm-cgo), type Handle uintptr
|
||||
pkg runtime/cgo (linux-386-cgo), func NewHandle(interface{}) Handle
|
||||
pkg runtime/cgo (linux-386-cgo), method (Handle) Delete()
|
||||
pkg runtime/cgo (linux-386-cgo), method (Handle) Value() interface{}
|
||||
pkg runtime/cgo (linux-386-cgo), type Handle uintptr
|
||||
pkg runtime/cgo (linux-amd64-cgo), func NewHandle(interface{}) Handle
|
||||
pkg runtime/cgo (linux-amd64-cgo), method (Handle) Delete()
|
||||
pkg runtime/cgo (linux-amd64-cgo), method (Handle) Value() interface{}
|
||||
pkg runtime/cgo (linux-amd64-cgo), type Handle uintptr
|
||||
pkg runtime/cgo (linux-arm-cgo), func NewHandle(interface{}) Handle
|
||||
pkg runtime/cgo (linux-arm-cgo), method (Handle) Delete()
|
||||
pkg runtime/cgo (linux-arm-cgo), method (Handle) Value() interface{}
|
||||
pkg runtime/cgo (linux-arm-cgo), type Handle uintptr
|
||||
pkg runtime/cgo (netbsd-386-cgo), func NewHandle(interface{}) Handle
|
||||
pkg runtime/cgo (netbsd-386-cgo), method (Handle) Delete()
|
||||
pkg runtime/cgo (netbsd-386-cgo), method (Handle) Value() interface{}
|
||||
pkg runtime/cgo (netbsd-386-cgo), type Handle uintptr
|
||||
pkg runtime/cgo (netbsd-amd64-cgo), func NewHandle(interface{}) Handle
|
||||
pkg runtime/cgo (netbsd-amd64-cgo), method (Handle) Delete()
|
||||
pkg runtime/cgo (netbsd-amd64-cgo), method (Handle) Value() interface{}
|
||||
pkg runtime/cgo (netbsd-amd64-cgo), type Handle uintptr
|
||||
pkg runtime/cgo (netbsd-arm-cgo), func NewHandle(interface{}) Handle
|
||||
pkg runtime/cgo (netbsd-arm-cgo), method (Handle) Delete()
|
||||
pkg runtime/cgo (netbsd-arm-cgo), method (Handle) Value() interface{}
|
||||
pkg runtime/cgo (netbsd-arm-cgo), type Handle uintptr
|
||||
pkg runtime/cgo (netbsd-arm64-cgo), func NewHandle(interface{}) Handle
|
||||
pkg runtime/cgo (netbsd-arm64-cgo), method (Handle) Delete()
|
||||
pkg runtime/cgo (netbsd-arm64-cgo), method (Handle) Value() interface{}
|
||||
pkg runtime/cgo (netbsd-arm64-cgo), type Handle uintptr
|
||||
pkg runtime/cgo (openbsd-386-cgo), func NewHandle(interface{}) Handle
|
||||
pkg runtime/cgo (openbsd-386-cgo), method (Handle) Delete()
|
||||
pkg runtime/cgo (openbsd-386-cgo), method (Handle) Value() interface{}
|
||||
pkg runtime/cgo (openbsd-386-cgo), type Handle uintptr
|
||||
pkg runtime/cgo (openbsd-amd64-cgo), func NewHandle(interface{}) Handle
|
||||
pkg runtime/cgo (openbsd-amd64-cgo), method (Handle) Delete()
|
||||
pkg runtime/cgo (openbsd-amd64-cgo), method (Handle) Value() interface{}
|
||||
pkg runtime/cgo (openbsd-amd64-cgo), type Handle uintptr
|
||||
pkg syscall (openbsd-386), const MSG_CMSG_CLOEXEC = 2048
|
||||
pkg syscall (openbsd-386), const MSG_CMSG_CLOEXEC ideal-int
|
||||
pkg syscall (openbsd-386-cgo), const MSG_CMSG_CLOEXEC = 2048
|
||||
pkg syscall (openbsd-386-cgo), const MSG_CMSG_CLOEXEC ideal-int
|
||||
pkg syscall (openbsd-amd64), const MSG_CMSG_CLOEXEC = 2048
|
||||
pkg syscall (openbsd-amd64), const MSG_CMSG_CLOEXEC ideal-int
|
||||
pkg syscall (openbsd-amd64-cgo), const MSG_CMSG_CLOEXEC = 2048
|
||||
pkg syscall (openbsd-amd64-cgo), const MSG_CMSG_CLOEXEC ideal-int
|
||||
pkg syscall (windows-386), type SysProcAttr struct, AdditionalInheritedHandles []Handle
|
||||
pkg syscall (windows-386), type SysProcAttr struct, ParentProcess Handle
|
||||
pkg syscall (windows-amd64), type SysProcAttr struct, AdditionalInheritedHandles []Handle
|
||||
pkg syscall (windows-amd64), type SysProcAttr struct, ParentProcess Handle
|
||||
pkg testing, method (*B) Setenv(string, string)
|
||||
pkg testing, method (*T) Setenv(string, string)
|
||||
pkg text/template/parse, const SkipFuncCheck = 2
|
||||
pkg text/template/parse, const SkipFuncCheck Mode
|
||||
pkg time, func UnixMicro(int64) Time
|
||||
pkg time, func UnixMilli(int64) Time
|
||||
pkg time, method (*Time) IsDST() bool
|
||||
pkg time, method (Time) UnixMicro() int64
|
||||
pkg time, method (Time) UnixMilli() int64
|
||||
1220
doc/go1.16.html
1220
doc/go1.16.html
File diff suppressed because it is too large
Load diff
535
doc/go1.17.html
Normal file
535
doc/go1.17.html
Normal file
|
|
@ -0,0 +1,535 @@
|
|||
<!--{
|
||||
"Title": "Go 1.17 Release Notes",
|
||||
"Path": "/doc/go1.17"
|
||||
}-->
|
||||
|
||||
<!--
|
||||
NOTE: In this document and others in this directory, the convention is to
|
||||
set fixed-width phrases with non-fixed-width spaces, as in
|
||||
<code>hello</code> <code>world</code>.
|
||||
Do not send CLs removing the interior tags from such phrases.
|
||||
-->
|
||||
|
||||
<style>
|
||||
main ul li { margin: 0.5em 0; }
|
||||
</style>
|
||||
|
||||
<h2 id="introduction">DRAFT RELEASE NOTES — Introduction to Go 1.17</h2>
|
||||
|
||||
<p>
|
||||
<strong>
|
||||
Go 1.17 is not yet released. These are work-in-progress
|
||||
release notes. Go 1.17 is expected to be released in August 2021.
|
||||
</strong>
|
||||
</p>
|
||||
|
||||
<h2 id="language">Changes to the language</h2>
|
||||
|
||||
<p><!-- CL 216424 -->
|
||||
TODO: <a href="https://golang.org/cl/216424">https://golang.org/cl/216424</a>: allow conversion from slice to array ptr
|
||||
</p>
|
||||
|
||||
<p><!-- CL 312212 -->
|
||||
TODO: <a href="https://golang.org/cl/312212">https://golang.org/cl/312212</a>: add unsafe.Add and unsafe.Slice
|
||||
</p>
|
||||
|
||||
<h2 id="ports">Ports</h2>
|
||||
|
||||
<h3 id="darwin">Darwin</h3>
|
||||
|
||||
<p><!-- golang.org/issue/23011 -->
|
||||
As <a href="go1.16#darwin">announced</a> in the Go 1.16 release
|
||||
notes, Go 1.17 requires macOS 10.13 High Sierra or later; support
|
||||
for previous versions has been discontinued.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
TODO: complete the Ports section
|
||||
</p>
|
||||
|
||||
<h2 id="tools">Tools</h2>
|
||||
|
||||
<p>
|
||||
TODO: complete the Tools section
|
||||
</p>
|
||||
|
||||
<h3 id="go-command">Go command</h3>
|
||||
|
||||
<h4 id="lazy-loading">Lazy module loading</h4>
|
||||
|
||||
<p><!-- golang.org/issue/36460 -->
|
||||
If a module specifies <code>go</code> <code>1.17</code> or higher in its
|
||||
<code>go.mod</code> file, its transitive requirements are now loaded lazily,
|
||||
avoding the need to download or read <code>go.mod</code> files for
|
||||
otherwise-irrelevant dependencies. To support lazy loading, in Go 1.17 modules
|
||||
the <code>go</code> command maintains <em>explicit</em> requirements in
|
||||
the <code>go.mod</code> file for every dependency that provides any package
|
||||
transitively imported by any package or test within the module.
|
||||
See <a href="https://golang.org/design/36460-lazy-module-loading">the design
|
||||
document</a> for more detail.
|
||||
<!-- TODO(bcmills): replace the design-doc link with proper documentation. -->
|
||||
</p>
|
||||
|
||||
<p><!-- golang.org/issue/45094 --> To facilitate the upgrade to lazy loading,
|
||||
the <code>go</code> <code>mod</code> <code>tidy</code> subcommand now supports
|
||||
a <code>-go</code> flag to set or change the <code>go</code> version in
|
||||
the <code>go.mod</code> file. To enable lazy loading for an existing module
|
||||
without changing the selected versions of its dependencies, run:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
go mod tidy -go=1.17
|
||||
</pre>
|
||||
|
||||
<h4 id="module-deprecation-comments">Module deprecation comments</h4>
|
||||
|
||||
<p><!-- golang.org/issue/40357 -->
|
||||
Module authors may deprecate a module by adding a
|
||||
<a href="/ref/mod#go-mod-file-module-deprecation"><code>// Deprecated:</code>
|
||||
comment</a> to <code>go.mod</code>, then tagging a new version.
|
||||
<code>go</code> <code>get</code> now prints a warning if a module needed to
|
||||
build packages named on the command line is deprecated. <code>go</code>
|
||||
<code>list</code> <code>-m</code> <code>-u</code> prints deprecations for all
|
||||
dependencies (use <code>-f</code> or <code>-json</code> to show the full
|
||||
message). The <code>go</code> command considers different major versions to
|
||||
be distinct modules, so this mechanism may be used, for example, to provide
|
||||
users with migration instructions for a new major version.
|
||||
</p>
|
||||
|
||||
<h4 id="go-get"><code>go</code> <code>get</code></h4>
|
||||
|
||||
<p><!-- golang.org/issue/37519 -->
|
||||
The <code>go</code> <code>get</code> <code>-insecure</code> flag is
|
||||
deprecated and has been removed. To permit the use of insecure schemes
|
||||
when fetching dependencies, please use the <code>GOINSECURE</code>
|
||||
environment variable. The <code>-insecure</code> flag also bypassed module
|
||||
sum validation, use <code>GOPRIVATE</code> or <code>GONOSUMDB</code> if
|
||||
you need that functionality. See <code>go</code> <code>help</code>
|
||||
<code>environment</code> for details.
|
||||
</p>
|
||||
|
||||
<h4 id="missing-go-directive"><code>go.mod</code> files missing <code>go</code> directives</h4>
|
||||
|
||||
<p><!-- golang.org/issue/44976 -->
|
||||
If the main module's <code>go.mod</code> file does not contain
|
||||
a <a href="/doc/modules/gomod-ref#go"><code>go</code> directive</a> and
|
||||
the <code>go</code> command cannot update the <code>go.mod</code> file, the
|
||||
<code>go</code> command now assumes <code>go 1.11</code> instead of the
|
||||
current release. (<code>go</code> <code>mod</code> <code>init</code> has added
|
||||
<code>go</code> directives automatically <a href="/doc/go1.12#modules">since
|
||||
Go 1.12</a>.)
|
||||
</p>
|
||||
|
||||
<p><!-- golang.org/issue/44976 -->
|
||||
If a module dependency lacks an explicit <code>go.mod</code> file, or
|
||||
its <code>go.mod</code> file does not contain
|
||||
a <a href="/doc/modules/gomod-ref#go"><code>go</code> directive</a>,
|
||||
the <code>go</code> command now assumes <code>go 1.16</code> for that
|
||||
dependency instead of the current release. (Dependencies developed in GOPATH
|
||||
mode may lack a <code>go.mod</code> file, and
|
||||
the <code>vendor/modules.txt</code> has to date never recorded
|
||||
the <code>go</code> versions indicated by dependencies' <code>go.mod</code>
|
||||
files.)
|
||||
</p>
|
||||
|
||||
<h4 id="vendor"><code>vendor</code> contents</h4>
|
||||
|
||||
<p><!-- golang.org/issue/36876 -->
|
||||
If the main module specifies <code>go</code> <code>1.17</code> or higher,
|
||||
<code>go</code> <code>mod</code> <code>vendor</code> now annotates
|
||||
<code>vendor/modules.txt</code> with the <code>go</code> version indicated by
|
||||
each vendored module in its own <code>go.mod</code> file. The annotated
|
||||
version is used when building the module's packages from vendored source code.
|
||||
</p>
|
||||
|
||||
<p><!-- golang.org/issue/42970 -->
|
||||
If the main module specifies <code>go</code> <code>1.17</code> or higher,
|
||||
<code>go</code> <code>mod</code> <code>vendor</code> now omits <code>go.mod</code>
|
||||
and <code>go.sum</code> files for vendored dependencies, which can otherwise
|
||||
interfere with the ability of the <code>go</code> command to identify the correct
|
||||
module root when invoked within the <code>vendor</code> tree.
|
||||
</p>
|
||||
|
||||
<h4 id="password-prompts">Password prompts</h4>
|
||||
|
||||
<p><!-- golang.org/issue/44904 -->
|
||||
The <code>go</code> command by default now suppresses SSH password prompts and
|
||||
Git Credential Manager prompts when fetching Git repositories using SSH, as it
|
||||
already did previously for other Git password prompts. Users authenticating to
|
||||
private Git repos with password-protected SSH may configure
|
||||
an <code>ssh-agent</code> to enable the <code>go</code> command to use
|
||||
password-protected SSH keys.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 249759 -->
|
||||
TODO: <a href="https://golang.org/cl/249759">https://golang.org/cl/249759</a>: cmd/cover: replace code using optimized golang.org/x/tools/cover
|
||||
</p>
|
||||
|
||||
<h3 id="vet">Vet</h3>
|
||||
|
||||
<p><!-- CL 299532 -->
|
||||
TODO: <a href="https://golang.org/cl/299532">https://golang.org/cl/299532</a>: cmd/vet: bring in sigchanyzer to report unbuffered channels to signal.Notify
|
||||
</p>
|
||||
|
||||
<p>
|
||||
TODO: complete the Vet section
|
||||
</p>
|
||||
|
||||
<h2 id="runtime">Runtime</h2>
|
||||
|
||||
<p><!-- CL 304470 -->
|
||||
TODO: <a href="https://golang.org/cl/304470">https://golang.org/cl/304470</a>: cmd/compile, runtime: add metadata for argument printing in traceback
|
||||
</p>
|
||||
|
||||
<p>
|
||||
TODO: complete the Runtime section
|
||||
</p>
|
||||
|
||||
<h2 id="compiler">Compiler</h2>
|
||||
|
||||
<p>
|
||||
TODO: complete the Compiler section, or delete if not needed
|
||||
</p>
|
||||
|
||||
<h2 id="linker">Linker</h2>
|
||||
|
||||
<p>
|
||||
TODO: complete the Linker section, or delete if not needed
|
||||
</p>
|
||||
|
||||
<h2 id="library">Core library</h2>
|
||||
|
||||
<p>
|
||||
TODO: complete the Core library section
|
||||
</p>
|
||||
|
||||
<h3 id="crypto/tls"><a href="/pkg/crypto/tls">crypto/tls</a></h3>
|
||||
|
||||
<p><!-- CL 295370 -->
|
||||
<a href="/pkg/crypto/tls#Conn.HandshakeContext">(*Conn).HandshakeContext</a> was added to
|
||||
allow the user to control cancellation of an in-progress TLS Handshake.
|
||||
The context provided is propagated into the
|
||||
<a href="/pkg/crypto/tls#ClientHelloInfo">ClientHelloInfo</a>
|
||||
and <a href="/pkg/crypto/tls#CertificateRequestInfo">CertificateRequestInfo</a>
|
||||
structs and accessible through the new
|
||||
<a href="/pkg/crypto/tls#ClientHelloInfo.Context">(*ClientHelloInfo).Context</a>
|
||||
and
|
||||
<a href="/pkg/crypto/tls#CertificateRequestInfo.Context">
|
||||
(*CertificateRequestInfo).Context
|
||||
</a> methods respectively. Canceling the context after the handshake has finished
|
||||
has no effect.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 289209 -->
|
||||
When <a href="/pkg/crypto/tls#Config">Config.NextProtos</a> is set, servers now
|
||||
enforce that there is an overlap between the configured protocols and the protocols
|
||||
advertised by the client, if any. If there is no overlap the connection is closed
|
||||
with the <code>no_application_protocol</code> alert, as required by RFC 7301.
|
||||
</p>
|
||||
|
||||
<h3 id="runtime/cgo"><a href="/pkg/runtime/cgo">Cgo</a></h3>
|
||||
|
||||
<p>
|
||||
The <a href="/pkg/runtime/cgo">runtime/cgo</a> package now provides a
|
||||
new facility that allows to turn any Go values to a safe representation
|
||||
that can be used to pass values between C and Go safely. See
|
||||
<a href="/pkg/runtime/cgo#Handle">runtime/cgo.Handle</a> for more information.
|
||||
</p>
|
||||
|
||||
<h3 id="minor_library_changes">Minor changes to the library</h3>
|
||||
|
||||
<p>
|
||||
As always, there are various minor changes and updates to the library,
|
||||
made with the Go 1 <a href="/doc/go1compat">promise of compatibility</a>
|
||||
in mind.
|
||||
</p>
|
||||
|
||||
<dl id="archive/zip"><dt><a href="/pkg/archive/zip/">archive/zip</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 312310 -->
|
||||
TODO: <a href="https://golang.org/cl/312310">https://golang.org/cl/312310</a>: add File.OpenRaw, Writer.CreateRaw, Writer.Copy
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- archive/zip -->
|
||||
|
||||
<dl id="bufio"><dt><a href="/pkg/bufio/">bufio</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 280492 -->
|
||||
The <a href="/pkg/bufio/#Writer.WriteRune"><code>Writer.WriteRune</code></a> method
|
||||
now writes the replacement character U+FFFD for negative rune values,
|
||||
as it does for other invalid runes.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- bufio -->
|
||||
|
||||
<dl id="bytes"><dt><a href="/pkg/bytes/">bytes</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 280492 -->
|
||||
The <a href="/pkg/bytes/#Buffer.WriteRune"><code>Buffer.WriteRune</code></a> method
|
||||
now writes the replacement character U+FFFD for negative rune values,
|
||||
as it does for other invalid runes.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- bytes -->
|
||||
|
||||
<dl id="compress/lzw"><dt><a href="/pkg/compress/lzw/">compress/lzw</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 273667 -->
|
||||
The new
|
||||
<a href="/pkg/compress/lzw/#Reader.Reset"><code>Reader.Reset</code></a>
|
||||
and
|
||||
<a href="/pkg/compress/lzw/#Writer.Reset"><code>Writer.Reset</code></a>
|
||||
methods allow reuse of a <code>Reader</code> or <code>Writer</code>.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- compress/lzw -->
|
||||
|
||||
<dl id="crypto/rsa"><dt><a href="/pkg/crypto/rsa/">crypto/rsa</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 302230 -->
|
||||
TODO: <a href="https://golang.org/cl/302230">https://golang.org/cl/302230</a>: fix salt length calculation with PSSSaltLengthAuto
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- crypto/rsa -->
|
||||
|
||||
<dl id="database/sql"><dt><a href="/pkg/database/sql/">database/sql</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 258360 -->
|
||||
TODO: <a href="https://golang.org/cl/258360">https://golang.org/cl/258360</a>: close driver.Connector if it implements io.Closer
|
||||
</p>
|
||||
|
||||
<p><!-- CL 311572 -->
|
||||
TODO: <a href="https://golang.org/cl/311572">https://golang.org/cl/311572</a>: add NullInt16 and NullByte
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- database/sql -->
|
||||
|
||||
<dl id="encoding/binary"><dt><a href="/pkg/encoding/binary/">encoding/binary</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 299531 -->
|
||||
<code>binary.Uvarint</code> will stop reading after <code>10 bytes</code> to avoid
|
||||
wasted computations. If more than <code>10 bytes</code> are needed, the byte count returned is <code>-11</code>.
|
||||
<br />
|
||||
Previous Go versions could return larger negative counts when reading incorrectly encoded varints.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- encoding/binary -->
|
||||
|
||||
<dl id="flag"><dt><a href="/pkg/flag/">flag</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 271788 -->
|
||||
TODO: <a href="https://golang.org/cl/271788">https://golang.org/cl/271788</a>: panic if flag name begins with - or contains =
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- flag -->
|
||||
|
||||
<dl id="io/fs"><dt><a href="/pkg/io/fs/">io/fs</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 293649 -->
|
||||
TODO: <a href="https://golang.org/cl/293649">https://golang.org/cl/293649</a>: implement FileInfoToDirEntry
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- io/fs -->
|
||||
|
||||
<dl id="math"><dt><a href="/pkg/math/">math</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 247058 -->
|
||||
TODO: <a href="https://golang.org/cl/247058">https://golang.org/cl/247058</a>: add MaxUint, MinInt, MaxInt
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- math -->
|
||||
|
||||
<dl id="mime"><dt><a href="/pkg/mime/">mime</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 305230 -->
|
||||
TODO: <a href="https://golang.org/cl/305230">https://golang.org/cl/305230</a>: support reading shared mime-info database on unix systems
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- mime -->
|
||||
|
||||
<dl id="net"><dt><a href="/pkg/net/">net</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 272668 -->
|
||||
TODO: <a href="https://golang.org/cl/272668">https://golang.org/cl/272668</a>: add IP.IsPrivate
|
||||
</p>
|
||||
|
||||
<p><!-- CL 301709 -->
|
||||
TODO: <a href="https://golang.org/cl/301709">https://golang.org/cl/301709</a>: make go resolver aware of network parameter
|
||||
</p>
|
||||
|
||||
<p><!-- CL 307030 -->
|
||||
TODO: <a href="https://golang.org/cl/307030">https://golang.org/cl/307030</a>: make ErrClosed and ParseError implement net.Error
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- net -->
|
||||
|
||||
<dl id="net/http"><dt><a href="/pkg/net/http/">net/http</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 295370 -->
|
||||
The <a href="/pkg/net/http/"><code>net/http</code></a> package now uses the new
|
||||
<a href="/pkg/crypto/tls#Conn.HandshakeContext"><code>(*tls.Conn).HandshakeContext</code></a>
|
||||
with the <a href="/pkg/net/http/#Request"><code>Request</code></a> context
|
||||
when performing TLS handshakes in the client or server.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 235437 -->
|
||||
TODO: <a href="https://golang.org/cl/235437">https://golang.org/cl/235437</a>: add to deadlines only when positive
|
||||
</p>
|
||||
|
||||
<p><!-- CL 308952 -->
|
||||
TODO: <a href="https://golang.org/cl/308952">https://golang.org/cl/308952</a>: make ReadRequest return an error when requests have multiple Host headers
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- net/http -->
|
||||
|
||||
<dl id="net/http/httptest"><dt><a href="/pkg/net/http/httptest/">net/http/httptest</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 308950 -->
|
||||
TODO: <a href="https://golang.org/cl/308950">https://golang.org/cl/308950</a>: panic on non-3 digit (XXX) status code in Recorder.WriteHeader
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- net/http/httptest -->
|
||||
|
||||
<dl id="net/url"><dt><a href="/pkg/net/url/">net/url</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 314850 -->
|
||||
TODO: <a href="https://golang.org/cl/314850">https://golang.org/cl/314850</a>: add Values.Has
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- net/url -->
|
||||
|
||||
<dl id="os"><dt><a href="/pkg/os/">os</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 268020 -->
|
||||
TODO: <a href="https://golang.org/cl/268020">https://golang.org/cl/268020</a>: avoid allocation in File.WriteString
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- os -->
|
||||
|
||||
<dl id="reflect"><dt><a href="/pkg/reflect/">reflect</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 266197 -->
|
||||
The new
|
||||
<a href="/pkg/reflect/#StructField.IsExported"><code>StructField.IsExported</code></a>
|
||||
and
|
||||
<a href="/pkg/reflect/#Method.IsExported"><code>Method.IsExported</code></a>
|
||||
methods report whether a struct field or type method is exported.
|
||||
They provide a more readable alternative to checking whether <code>PkgPath</code>
|
||||
is empty.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 281233 -->
|
||||
TODO: <a href="https://golang.org/cl/281233">https://golang.org/cl/281233</a>: add VisibleFields function
|
||||
</p>
|
||||
|
||||
<p><!-- CL 284136 -->
|
||||
TODO: <a href="https://golang.org/cl/284136">https://golang.org/cl/284136</a>: panic if ArrayOf is called with negative length
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- reflect -->
|
||||
|
||||
<dl id="strconv"><dt><a href="/pkg/strconv/">strconv</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 170079 -->
|
||||
TODO: <a href="https://golang.org/cl/170079">https://golang.org/cl/170079</a>: implement Ryū-like algorithm for fixed precision ftoa
|
||||
</p>
|
||||
|
||||
<p><!-- CL 170080 -->
|
||||
TODO: <a href="https://golang.org/cl/170080">https://golang.org/cl/170080</a>: Implement Ryū algorithm for ftoa shortest mode
|
||||
</p>
|
||||
|
||||
<p><!-- CL 314775 -->
|
||||
The new <a href="/pkg/strconv/#QuotedPrefix"><code>QuotedPrefix</code></a> function
|
||||
returns the quoted string (as understood by
|
||||
<a href="/pkg/strconv/#Unquote"><code>Unquote</code></a>)
|
||||
at the start of input.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- strconv -->
|
||||
|
||||
<dl id="strings"><dt><a href="/pkg/strings/">strings</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 280492 -->
|
||||
The <a href="/pkg/strings/#Builder.WriteRune"><code>Builder.WriteRune</code></a> method
|
||||
now writes the replacement character U+FFFD for negative rune values,
|
||||
as it does for other invalid runes.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- strings -->
|
||||
|
||||
<dl id="sync/atomic"><dt><a href="/pkg/sync/atomic/">sync/atomic</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 241678 -->
|
||||
TODO: <a href="https://golang.org/cl/241678">https://golang.org/cl/241678</a>: add (*Value).Swap and (*Value).CompareAndSwap
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- sync/atomic -->
|
||||
|
||||
<dl id="syscall"><dt><a href="/pkg/syscall/">syscall</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 295371 -->
|
||||
TODO: <a href="https://golang.org/cl/295371">https://golang.org/cl/295371</a>: do not overflow key memory in GetQueuedCompletionStatus
|
||||
</p>
|
||||
|
||||
<p><!-- CL 313653 -->
|
||||
TODO: <a href="https://golang.org/cl/313653">https://golang.org/cl/313653</a>: restore signal mask after setting foreground process group
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- syscall -->
|
||||
|
||||
<dl id="testing"><dt><a href="/pkg/testing/">testing</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 310033 -->
|
||||
TODO: <a href="https://golang.org/cl/310033">https://golang.org/cl/310033</a>: add -shuffle=off|on|N to alter the execution order of tests and benchmarks
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- testing -->
|
||||
|
||||
<dl id="text/template/parse"><dt><a href="/pkg/text/template/parse/">text/template/parse</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 301493 -->
|
||||
TODO: <a href="https://golang.org/cl/301493">https://golang.org/cl/301493</a>: add a mode to skip func-check on parsing
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- text/template/parse -->
|
||||
|
||||
<dl id="time"><dt><a href="/pkg/time/">time</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 260858 -->
|
||||
time.Time now has a <a href="/pkg/time/#Time.GoString">GoString</a>
|
||||
method that will return a more useful value for times when printed with
|
||||
the <code>"%#v"</code> format specifier in the fmt package.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 264077 -->
|
||||
TODO: <a href="https://golang.org/cl/264077">https://golang.org/cl/264077</a>: add Time.IsDST() to check if its Location is in Daylight Savings Time
|
||||
</p>
|
||||
|
||||
<p><!-- CL 293349 -->
|
||||
TODO: <a href="https://golang.org/cl/293349">https://golang.org/cl/293349</a>: add Time.Unix{Milli,Micro} and to-Time helpers UnixMicro, UnixMilli
|
||||
</p>
|
||||
|
||||
<p><!-- CL 300996 -->
|
||||
TODO: <a href="https://golang.org/cl/300996">https://golang.org/cl/300996</a>: support "," as separator for fractional seconds
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- time -->
|
||||
|
||||
<dl id="unicode"><dt><a href="/pkg/unicode/">unicode</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 280493 -->
|
||||
The <a href="/pkg/unicode/#Is"><code>Is</code></a>,
|
||||
<a href="/pkg/unicode/#IsGraphic"><code>IsGraphic</code></a>,
|
||||
<a href="/pkg/unicode/#IsLetter"><code>IsLetter</code></a>,
|
||||
<a href="/pkg/unicode/#IsLower"><code>IsLower</code></a>,
|
||||
<a href="/pkg/unicode/#IsMark"><code>IsMark</code></a>,
|
||||
<a href="/pkg/unicode/#IsNumber"><code>IsNumber</code></a>,
|
||||
<a href="/pkg/unicode/#IsPrint"><code>IsPrint</code></a>,
|
||||
<a href="/pkg/unicode/#IsPunct"><code>IsPunct</code></a>,
|
||||
<a href="/pkg/unicode/#IsSpace"><code>IsSpace</code></a>,
|
||||
<a href="/pkg/unicode/#IsSymbol"><code>IsSymbol</code></a>, and
|
||||
<a href="/pkg/unicode/#IsUpper"><code>IsUpper</code></a> functions
|
||||
now return <code>false</code> on negative rune values, as they do for other invalid runes.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- unicode -->
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<!--{
|
||||
"Title": "The Go Programming Language Specification",
|
||||
"Subtitle": "Version of Feb 10, 2021",
|
||||
"Subtitle": "Version of Apr 28, 2021",
|
||||
"Path": "/ref/spec"
|
||||
}-->
|
||||
|
||||
|
|
@ -830,7 +830,7 @@ The underlying type of <code>[]B1</code>, <code>B3</code>, and <code>B4</code> i
|
|||
|
||||
<h3 id="Method_sets">Method sets</h3>
|
||||
<p>
|
||||
A type may have a <i>method set</i> associated with it.
|
||||
A type has a (possibly empty) <i>method set</i> associated with it.
|
||||
The method set of an <a href="#Interface_types">interface type</a> is its interface.
|
||||
The method set of any other type <code>T</code> consists of all
|
||||
<a href="#Method_declarations">methods</a> declared with receiver type <code>T</code>.
|
||||
|
|
@ -3532,9 +3532,9 @@ within <code>Greeting</code>, <code>who</code> will have the value
|
|||
</p>
|
||||
|
||||
<p>
|
||||
If the final argument is assignable to a slice type <code>[]T</code>, it is
|
||||
passed unchanged as the value for a <code>...T</code> parameter if the argument
|
||||
is followed by <code>...</code>. In this case no new slice is created.
|
||||
If the final argument is assignable to a slice type <code>[]T</code> and
|
||||
is followed by <code>...</code>, it is passed unchanged as the value
|
||||
for a <code>...T</code> parameter. In this case no new slice is created.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
|
@ -3681,8 +3681,8 @@ The bitwise logical and shift operators apply to integers only.
|
|||
^ bitwise XOR integers
|
||||
&^ bit clear (AND NOT) integers
|
||||
|
||||
<< left shift integer << unsigned integer
|
||||
>> right shift integer >> unsigned integer
|
||||
<< left shift integer << integer >= 0
|
||||
>> right shift integer >> integer >= 0
|
||||
</pre>
|
||||
|
||||
|
||||
|
|
@ -4164,6 +4164,10 @@ in any of these cases:
|
|||
<li>
|
||||
<code>x</code> is a string and <code>T</code> is a slice of bytes or runes.
|
||||
</li>
|
||||
<li>
|
||||
<code>x</code> is a slice, <code>T</code> is a pointer to an array,
|
||||
and the slice and array types have <a href="#Type_identity">identical</a> element types.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
|
|
@ -4314,6 +4318,24 @@ MyRunes("白鵬翔") // []rune{0x767d, 0x9d6c, 0x7fd4}
|
|||
</li>
|
||||
</ol>
|
||||
|
||||
<h4 id="Conversions_from_slice_to_array_pointer">Conversions from slice to array pointer</h4>
|
||||
|
||||
<p>
|
||||
Converting a slice to an array pointer yields a pointer to the underlying array of the slice.
|
||||
If the <a href="#Length_and_capacity">length</a> of the slice is less than the length of the array,
|
||||
a <a href="#Run_time_panics">run-time panic</a> occurs.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
s := make([]byte, 2, 4)
|
||||
s0 := (*[0]byte)(s) // s0 != nil
|
||||
s2 := (*[2]byte)(s) // &s2[0] == &s[0]
|
||||
s4 := (*[4]byte)(s) // panics: len([4]byte) > len(s)
|
||||
|
||||
var t []string
|
||||
t0 := (*[0]string)(t) // t0 == nil
|
||||
t1 := (*[1]string)(t) // panics: len([1]string) > len(s)
|
||||
</pre>
|
||||
|
||||
<h3 id="Constant_expressions">Constant expressions</h3>
|
||||
|
||||
|
|
@ -4931,9 +4953,9 @@ ExprSwitchCase = "case" ExpressionList | "default" .
|
|||
|
||||
<p>
|
||||
If the switch expression evaluates to an untyped constant, it is first implicitly
|
||||
<a href="#Conversions">converted</a> to its <a href="#Constants">default type</a>;
|
||||
if it is an untyped boolean value, it is first implicitly converted to type <code>bool</code>.
|
||||
<a href="#Conversions">converted</a> to its <a href="#Constants">default type</a>.
|
||||
The predeclared untyped value <code>nil</code> cannot be used as a switch expression.
|
||||
The switch expression type must be <a href="#Comparison_operators">comparable</a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
|
@ -6689,6 +6711,10 @@ type Pointer *ArbitraryType
|
|||
func Alignof(variable ArbitraryType) uintptr
|
||||
func Offsetof(selector ArbitraryType) uintptr
|
||||
func Sizeof(variable ArbitraryType) uintptr
|
||||
|
||||
type IntegerType int // shorthand for an integer type; it is not a real type
|
||||
func Add(ptr Pointer, len IntegerType) Pointer
|
||||
func Slice(ptr *ArbitraryType, len IntegerType) []ArbitraryType
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
|
|
@ -6745,6 +6771,32 @@ Calls to <code>Alignof</code>, <code>Offsetof</code>, and
|
|||
<code>Sizeof</code> are compile-time constant expressions of type <code>uintptr</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The function <code>Add</code> adds <code>len</code> to <code>ptr</code>
|
||||
and returns the updated pointer <code>unsafe.Pointer(uintptr(ptr) + uintptr(len))</code>.
|
||||
The <code>len</code> argument must be of integer type or an untyped <a href="#Constants">constant</a>.
|
||||
A constant <code>len</code> argument must be <a href="#Representability">representable</a> by a value of type <code>int</code>;
|
||||
if it is an untyped constant it is given type <code>int</code>.
|
||||
The rules for <a href="/pkg/unsafe#Pointer">valid uses</a> of <code>Pointer</code> still apply.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The function <code>Slice</code> returns a slice whose underlying array starts at <code>ptr</code>
|
||||
and whose length and capacity are <code>len</code>:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
(*[len]ArbitraryType)(unsafe.Pointer(ptr))[:]
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
The <code>len</code> argument must be of integer type or an untyped <a href="#Constants">constant</a>.
|
||||
A constant <code>len</code> argument must be non-negative and <a href="#Representability">representable</a> by a value of type <code>int</code>;
|
||||
if it is an untyped constant it is given type <code>int</code>.
|
||||
If <code>ptr</code> is <code>nil</code> or <code>len</code> is negative at run time,
|
||||
a <a href="#Run_time_panics">run-time panic</a> occurs.
|
||||
</p>
|
||||
|
||||
<h3 id="Size_and_alignment_guarantees">Size and alignment guarantees</h3>
|
||||
|
||||
<p>
|
||||
|
|
|
|||
BIN
favicon.ico
BIN
favicon.ico
Binary file not shown.
|
Before Width: | Height: | Size: 5.6 KiB |
|
|
@ -14,7 +14,6 @@ import (
|
|||
"fmt"
|
||||
"go/build"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
|
|
@ -276,7 +275,7 @@ func adbCopyGoroot() error {
|
|||
if err := syscall.Flock(int(stat.Fd()), syscall.LOCK_EX); err != nil {
|
||||
return err
|
||||
}
|
||||
s, err := ioutil.ReadAll(stat)
|
||||
s, err := io.ReadAll(stat)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
@ -294,7 +293,7 @@ func adbCopyGoroot() error {
|
|||
goroot := runtime.GOROOT()
|
||||
// Build go for android.
|
||||
goCmd := filepath.Join(goroot, "bin", "go")
|
||||
tmpGo, err := ioutil.TempFile("", "go_android_exec-cmd-go-*")
|
||||
tmpGo, err := os.CreateTemp("", "go_android_exec-cmd-go-*")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
134
misc/cgo/errors/argposition_test.go
Normal file
134
misc/cgo/errors/argposition_test.go
Normal file
|
|
@ -0,0 +1,134 @@
|
|||
// Copyright 2021 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.
|
||||
|
||||
// Issue 42580: cmd/cgo: shifting identifier position in ast
|
||||
|
||||
package errorstest
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"go/ast"
|
||||
"go/parser"
|
||||
"go/token"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
type ShortPosition struct {
|
||||
Line int
|
||||
Column int
|
||||
Visited bool
|
||||
}
|
||||
|
||||
type IdentPositionInfo map[string][]ShortPosition
|
||||
|
||||
type Visitor struct {
|
||||
identPosInfo IdentPositionInfo
|
||||
fset *token.FileSet
|
||||
t *testing.T
|
||||
}
|
||||
|
||||
func (v *Visitor) Visit(node ast.Node) ast.Visitor {
|
||||
if ident, ok := node.(*ast.Ident); ok {
|
||||
if expectedPositions, ok := v.identPosInfo[ident.Name]; ok {
|
||||
gotMatch := false
|
||||
var errorMessage strings.Builder
|
||||
for caseIndex, expectedPos := range expectedPositions {
|
||||
actualPosition := v.fset.PositionFor(ident.Pos(), true)
|
||||
errorOccured := false
|
||||
if expectedPos.Line != actualPosition.Line {
|
||||
fmt.Fprintf(&errorMessage, "wrong line number for ident %s: expected: %d got: %d\n", ident.Name, expectedPos.Line, actualPosition.Line)
|
||||
errorOccured = true
|
||||
}
|
||||
if expectedPos.Column != actualPosition.Column {
|
||||
fmt.Fprintf(&errorMessage, "wrong column number for ident %s: expected: %d got: %d\n", ident.Name, expectedPos.Column, actualPosition.Column)
|
||||
errorOccured = true
|
||||
}
|
||||
if errorOccured {
|
||||
continue
|
||||
}
|
||||
gotMatch = true
|
||||
expectedPositions[caseIndex].Visited = true
|
||||
}
|
||||
|
||||
if !gotMatch {
|
||||
v.t.Errorf(errorMessage.String())
|
||||
}
|
||||
}
|
||||
}
|
||||
return v
|
||||
}
|
||||
|
||||
func TestArgumentsPositions(t *testing.T) {
|
||||
testdata, err := filepath.Abs("testdata")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
tmpPath := t.TempDir()
|
||||
|
||||
dir := filepath.Join(tmpPath, "src", "testpositions")
|
||||
if err := os.MkdirAll(dir, 0755); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
cmd := exec.Command("go", "tool", "cgo",
|
||||
"-srcdir", testdata,
|
||||
"-objdir", dir,
|
||||
"issue42580.go")
|
||||
cmd.Stderr = new(bytes.Buffer)
|
||||
|
||||
err = cmd.Run()
|
||||
if err != nil {
|
||||
t.Fatalf("%s: %v\n%s", cmd, err, cmd.Stderr)
|
||||
}
|
||||
mainProcessed, err := ioutil.ReadFile(filepath.Join(dir, "issue42580.cgo1.go"))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
fset := token.NewFileSet()
|
||||
f, err := parser.ParseFile(fset, "", mainProcessed, parser.AllErrors)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
return
|
||||
}
|
||||
|
||||
expectation := IdentPositionInfo{
|
||||
"checkedPointer": []ShortPosition{
|
||||
ShortPosition{
|
||||
Line: 32,
|
||||
Column: 56,
|
||||
},
|
||||
},
|
||||
"singleInnerPointerChecked": []ShortPosition{
|
||||
ShortPosition{
|
||||
Line: 37,
|
||||
Column: 91,
|
||||
},
|
||||
},
|
||||
"doublePointerChecked": []ShortPosition{
|
||||
ShortPosition{
|
||||
Line: 42,
|
||||
Column: 91,
|
||||
},
|
||||
},
|
||||
}
|
||||
for _, decl := range f.Decls {
|
||||
if fdecl, ok := decl.(*ast.FuncDecl); ok {
|
||||
ast.Walk(&Visitor{expectation, fset, t}, fdecl.Body)
|
||||
}
|
||||
}
|
||||
for ident, positions := range expectation {
|
||||
for _, position := range positions {
|
||||
if !position.Visited {
|
||||
t.Errorf("Position %d:%d missed for %s ident", position.Line, position.Column, ident)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -6,7 +6,6 @@ package errorstest
|
|||
|
||||
import (
|
||||
"bytes"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
|
|
@ -55,7 +54,7 @@ func TestBadSymbol(t *testing.T) {
|
|||
|
||||
makeFile := func(mdir, base, source string) string {
|
||||
ret := filepath.Join(mdir, base)
|
||||
if err := ioutil.WriteFile(ret, []byte(source), 0644); err != nil {
|
||||
if err := os.WriteFile(ret, []byte(source), 0644); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
return ret
|
||||
|
|
@ -100,7 +99,7 @@ func TestBadSymbol(t *testing.T) {
|
|||
// _cgo_import.go.
|
||||
|
||||
rewrite := func(from, to string) {
|
||||
obj, err := ioutil.ReadFile(from)
|
||||
obj, err := os.ReadFile(from)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
|
@ -115,7 +114,7 @@ func TestBadSymbol(t *testing.T) {
|
|||
|
||||
obj = bytes.ReplaceAll(obj, []byte(magicInput), []byte(magicReplace))
|
||||
|
||||
if err := ioutil.WriteFile(to, obj, 0644); err != nil {
|
||||
if err := os.WriteFile(to, obj, 0644); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ package errorstest
|
|||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
|
|
@ -25,7 +24,7 @@ func check(t *testing.T, file string) {
|
|||
t.Run(file, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
contents, err := ioutil.ReadFile(path(file))
|
||||
contents, err := os.ReadFile(path(file))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
|
@ -56,7 +55,7 @@ func check(t *testing.T, file string) {
|
|||
}
|
||||
|
||||
func expect(t *testing.T, file string, errors []*regexp.Regexp) {
|
||||
dir, err := ioutil.TempDir("", filepath.Base(t.Name()))
|
||||
dir, err := os.MkdirTemp("", filepath.Base(t.Name()))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ import (
|
|||
"bytes"
|
||||
"flag"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
|
|
@ -463,7 +462,7 @@ func buildPtrTests(t *testing.T) (dir, exe string) {
|
|||
gopath = *tmp
|
||||
dir = ""
|
||||
} else {
|
||||
d, err := ioutil.TempDir("", filepath.Base(t.Name()))
|
||||
d, err := os.MkdirTemp("", filepath.Base(t.Name()))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
|
@ -475,7 +474,7 @@ func buildPtrTests(t *testing.T) (dir, exe string) {
|
|||
if err := os.MkdirAll(src, 0777); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := ioutil.WriteFile(filepath.Join(src, "go.mod"), []byte("module ptrtest"), 0666); err != nil {
|
||||
if err := os.WriteFile(filepath.Join(src, "go.mod"), []byte("module ptrtest"), 0666); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
|
|
@ -535,10 +534,10 @@ func buildPtrTests(t *testing.T) (dir, exe string) {
|
|||
fmt.Fprintf(&cgo1, "}\n\n")
|
||||
fmt.Fprintf(&cgo1, "%s\n", ptrTestMain)
|
||||
|
||||
if err := ioutil.WriteFile(filepath.Join(src, "cgo1.go"), cgo1.Bytes(), 0666); err != nil {
|
||||
if err := os.WriteFile(filepath.Join(src, "cgo1.go"), cgo1.Bytes(), 0666); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := ioutil.WriteFile(filepath.Join(src, "cgo2.go"), cgo2.Bytes(), 0666); err != nil {
|
||||
if err := os.WriteFile(filepath.Join(src, "cgo2.go"), cgo2.Bytes(), 0666); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
|
|
|
|||
44
misc/cgo/errors/testdata/issue42580.go
vendored
Normal file
44
misc/cgo/errors/testdata/issue42580.go
vendored
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
// Copyright 2021 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.
|
||||
|
||||
// Issue 42580: cmd/cgo: shifting identifier position in ast
|
||||
|
||||
package cgotest
|
||||
|
||||
// typedef int (*intFunc) ();
|
||||
//
|
||||
// char* strarg = "";
|
||||
//
|
||||
// int func_with_char(char* arg, void* dummy)
|
||||
// {return 5;}
|
||||
//
|
||||
// int* get_arr(char* arg, void* dummy)
|
||||
// {return NULL;}
|
||||
import "C"
|
||||
import "unsafe"
|
||||
|
||||
// Test variables
|
||||
var (
|
||||
checkedPointer = []byte{1}
|
||||
doublePointerChecked = []byte{1}
|
||||
singleInnerPointerChecked = []byte{1}
|
||||
)
|
||||
|
||||
// This test checks the positions of variable identifiers.
|
||||
// Changing the positions of the test variables idents after this point will break the test.
|
||||
|
||||
func TestSingleArgumentCast() C.int {
|
||||
retcode := C.func_with_char((*C.char)(unsafe.Pointer(&checkedPointer[0])), unsafe.Pointer(C.strarg))
|
||||
return retcode
|
||||
}
|
||||
|
||||
func TestSingleArgumentCastRecFuncAsSimpleArg() C.int {
|
||||
retcode := C.func_with_char((*C.char)(unsafe.Pointer(C.get_arr((*C.char)(unsafe.Pointer(&singleInnerPointerChecked[0])), unsafe.Pointer(C.strarg)))), nil)
|
||||
return retcode
|
||||
}
|
||||
|
||||
func TestSingleArgumentCastRecFunc() C.int {
|
||||
retcode := C.func_with_char((*C.char)(unsafe.Pointer(C.get_arr((*C.char)(unsafe.Pointer(&doublePointerChecked[0])), unsafe.Pointer(C.strarg)))), unsafe.Pointer(C.strarg))
|
||||
return retcode
|
||||
}
|
||||
|
|
@ -6,7 +6,6 @@ package life_test
|
|||
|
||||
import (
|
||||
"bytes"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
|
|
@ -21,7 +20,7 @@ func TestMain(m *testing.M) {
|
|||
}
|
||||
|
||||
func testMain(m *testing.M) int {
|
||||
GOPATH, err := ioutil.TempDir("", "cgolife")
|
||||
GOPATH, err := os.MkdirTemp("", "cgolife")
|
||||
if err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
|
|
@ -38,7 +37,7 @@ func testMain(m *testing.M) int {
|
|||
log.Panic(err)
|
||||
}
|
||||
os.Setenv("PWD", modRoot)
|
||||
if err := ioutil.WriteFile("go.mod", []byte("module cgolife\n"), 0666); err != nil {
|
||||
if err := os.WriteFile("go.mod", []byte("module cgolife\n"), 0666); err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ package stdio_test
|
|||
|
||||
import (
|
||||
"bytes"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
|
|
@ -21,7 +20,7 @@ func TestMain(m *testing.M) {
|
|||
}
|
||||
|
||||
func testMain(m *testing.M) int {
|
||||
GOPATH, err := ioutil.TempDir("", "cgostdio")
|
||||
GOPATH, err := os.MkdirTemp("", "cgostdio")
|
||||
if err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
|
|
@ -38,7 +37,7 @@ func testMain(m *testing.M) int {
|
|||
log.Panic(err)
|
||||
}
|
||||
os.Setenv("PWD", modRoot)
|
||||
if err := ioutil.WriteFile("go.mod", []byte("module cgostdio\n"), 0666); err != nil {
|
||||
if err := os.WriteFile("go.mod", []byte("module cgostdio\n"), 0666); err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ func Test28896(t *testing.T) { test28896(t) }
|
|||
func Test30065(t *testing.T) { test30065(t) }
|
||||
func Test32579(t *testing.T) { test32579(t) }
|
||||
func Test31891(t *testing.T) { test31891(t) }
|
||||
func Test45451(t *testing.T) { test45451(t) }
|
||||
func TestAlign(t *testing.T) { testAlign(t) }
|
||||
func TestAtol(t *testing.T) { testAtol(t) }
|
||||
func TestBlocking(t *testing.T) { testBlocking(t) }
|
||||
|
|
@ -80,6 +81,7 @@ func TestNamedEnum(t *testing.T) { testNamedEnum(t) }
|
|||
func TestCastToEnum(t *testing.T) { testCastToEnum(t) }
|
||||
func TestErrno(t *testing.T) { testErrno(t) }
|
||||
func TestFpVar(t *testing.T) { testFpVar(t) }
|
||||
func TestHandle(t *testing.T) { testHandle(t) }
|
||||
func TestHelpers(t *testing.T) { testHelpers(t) }
|
||||
func TestLibgcc(t *testing.T) { testLibgcc(t) }
|
||||
func TestMultipleAssign(t *testing.T) { testMultipleAssign(t) }
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ package cgotest
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"strings"
|
||||
"syscall"
|
||||
"testing"
|
||||
|
|
@ -64,7 +64,7 @@ import "C"
|
|||
func compareStatus(filter, expect string) error {
|
||||
expected := filter + expect
|
||||
pid := syscall.Getpid()
|
||||
fs, err := ioutil.ReadDir(fmt.Sprintf("/proc/%d/task", pid))
|
||||
fs, err := os.ReadDir(fmt.Sprintf("/proc/%d/task", pid))
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to find %d tasks: %v", pid, err)
|
||||
}
|
||||
|
|
@ -72,7 +72,7 @@ func compareStatus(filter, expect string) error {
|
|||
foundAThread := false
|
||||
for _, f := range fs {
|
||||
tf := fmt.Sprintf("/proc/%s/status", f.Name())
|
||||
d, err := ioutil.ReadFile(tf)
|
||||
d, err := os.ReadFile(tf)
|
||||
if err != nil {
|
||||
// There are a surprising number of ways this
|
||||
// can error out on linux. We've seen all of
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
// +build !android
|
||||
|
||||
// Test that pthread_cancel works as expected
|
||||
// (NPTL uses SIGRTMIN to implement thread cancelation)
|
||||
// (NPTL uses SIGRTMIN to implement thread cancellation)
|
||||
// See https://golang.org/issue/6997
|
||||
package cgotest
|
||||
|
||||
|
|
@ -17,8 +17,10 @@ extern int CancelThread();
|
|||
*/
|
||||
import "C"
|
||||
|
||||
import "testing"
|
||||
import "time"
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func test6997(t *testing.T) {
|
||||
r := C.StartThread()
|
||||
|
|
|
|||
11
misc/cgo/test/issue8148.c
Normal file
11
misc/cgo/test/issue8148.c
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
// Copyright 2014 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.
|
||||
|
||||
#include "_cgo_export.h"
|
||||
|
||||
int get8148(void) {
|
||||
T t;
|
||||
t.i = 42;
|
||||
return issue8148Callback(&t);
|
||||
}
|
||||
|
|
@ -10,14 +10,7 @@ package cgotest
|
|||
|
||||
/*
|
||||
typedef struct { int i; } T;
|
||||
|
||||
int issue8148Callback(T*);
|
||||
|
||||
static int get() {
|
||||
T t;
|
||||
t.i = 42;
|
||||
return issue8148Callback(&t);
|
||||
}
|
||||
int get8148(void);
|
||||
*/
|
||||
import "C"
|
||||
|
||||
|
|
@ -27,5 +20,5 @@ func issue8148Callback(t *C.T) C.int {
|
|||
}
|
||||
|
||||
func Issue8148() int {
|
||||
return int(C.get())
|
||||
return int(C.get8148())
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@
|
|||
package cgotest
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
|
|
@ -37,7 +36,7 @@ func TestCrossPackageTests(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
GOPATH, err := ioutil.TempDir("", "cgotest")
|
||||
GOPATH, err := os.MkdirTemp("", "cgotest")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
|
@ -47,7 +46,7 @@ func TestCrossPackageTests(t *testing.T) {
|
|||
if err := overlayDir(modRoot, "testdata"); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := ioutil.WriteFile(filepath.Join(modRoot, "go.mod"), []byte("module cgotest\n"), 0666); err != nil {
|
||||
if err := os.WriteFile(filepath.Join(modRoot, "go.mod"), []byte("module cgotest\n"), 0666); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// Test that setgid does not hang on GNU/Linux.
|
||||
// Test that setgid does not hang on Linux.
|
||||
// See https://golang.org/issue/3871 for details.
|
||||
|
||||
package cgotest
|
||||
|
|
|
|||
|
|
@ -899,6 +899,10 @@ static uint16_t issue31093F(uint16_t v) { return v; }
|
|||
// issue 32579
|
||||
typedef struct S32579 { unsigned char data[1]; } S32579;
|
||||
|
||||
// issue 37033, cgo.Handle
|
||||
extern void GoFunc37033(uintptr_t handle);
|
||||
void cFunc37033(uintptr_t handle) { GoFunc37033(handle); }
|
||||
|
||||
// issue 38649
|
||||
// Test that #define'd type aliases work.
|
||||
#define netbsd_gid unsigned int
|
||||
|
|
@ -908,6 +912,9 @@ typedef struct S32579 { unsigned char data[1]; } S32579;
|
|||
enum Enum40494 { X_40494 };
|
||||
union Union40494 { int x; };
|
||||
void issue40494(enum Enum40494 e, union Union40494* up) {}
|
||||
|
||||
// Issue 45451, bad handling of go:notinheap types.
|
||||
typedef struct issue45451Undefined issue45451;
|
||||
*/
|
||||
import "C"
|
||||
|
||||
|
|
@ -920,6 +927,7 @@ import (
|
|||
"os/signal"
|
||||
"reflect"
|
||||
"runtime"
|
||||
"runtime/cgo"
|
||||
"sync"
|
||||
"syscall"
|
||||
"testing"
|
||||
|
|
@ -2230,6 +2238,23 @@ func test32579(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
// issue 37033, check if cgo.Handle works properly
|
||||
|
||||
func testHandle(t *testing.T) {
|
||||
ch := make(chan int)
|
||||
|
||||
for i := 0; i < 42; i++ {
|
||||
h := cgo.NewHandle(ch)
|
||||
go func() {
|
||||
C.cFunc37033(C.uintptr_t(h))
|
||||
}()
|
||||
if v := <-ch; issue37033 != v {
|
||||
t.Fatalf("unexpected receiving value: got %d, want %d", v, issue37033)
|
||||
}
|
||||
h.Delete()
|
||||
}
|
||||
}
|
||||
|
||||
// issue 38649
|
||||
|
||||
var issue38649 C.netbsd_gid = 42
|
||||
|
|
@ -2244,3 +2269,19 @@ var issue39877 *C.void = nil
|
|||
func Issue40494() {
|
||||
C.issue40494(C.enum_Enum40494(C.X_40494), (*C.union_Union40494)(nil))
|
||||
}
|
||||
|
||||
// Issue 45451.
|
||||
func test45451(t *testing.T) {
|
||||
var u *C.issue45451
|
||||
typ := reflect.ValueOf(u).Type().Elem()
|
||||
|
||||
// The type is undefined in C so allocating it should panic.
|
||||
defer func() {
|
||||
if r := recover(); r == nil {
|
||||
t.Error("expected panic")
|
||||
}
|
||||
}()
|
||||
|
||||
_ = reflect.New(typ)
|
||||
t.Errorf("reflect.New(%v) should have panicked", typ)
|
||||
}
|
||||
|
|
|
|||
2
misc/cgo/test/testdata/issue9400/asm_386.s
vendored
2
misc/cgo/test/testdata/issue9400/asm_386.s
vendored
|
|
@ -2,7 +2,7 @@
|
|||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build !gccgo
|
||||
// +build gc
|
||||
|
||||
#include "textflag.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build amd64 amd64p32
|
||||
// +build !gccgo
|
||||
// +build gc
|
||||
|
||||
#include "textflag.h"
|
||||
|
||||
|
|
|
|||
2
misc/cgo/test/testdata/issue9400/asm_arm.s
vendored
2
misc/cgo/test/testdata/issue9400/asm_arm.s
vendored
|
|
@ -2,7 +2,7 @@
|
|||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build !gccgo
|
||||
// +build gc
|
||||
|
||||
#include "textflag.h"
|
||||
|
||||
|
|
|
|||
2
misc/cgo/test/testdata/issue9400/asm_arm64.s
vendored
2
misc/cgo/test/testdata/issue9400/asm_arm64.s
vendored
|
|
@ -2,7 +2,7 @@
|
|||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build !gccgo
|
||||
// +build gc
|
||||
|
||||
#include "textflag.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build mips64 mips64le
|
||||
// +build !gccgo
|
||||
// +build gc
|
||||
|
||||
#include "textflag.h"
|
||||
|
||||
|
|
|
|||
2
misc/cgo/test/testdata/issue9400/asm_mipsx.s
vendored
2
misc/cgo/test/testdata/issue9400/asm_mipsx.s
vendored
|
|
@ -3,7 +3,7 @@
|
|||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build mips mipsle
|
||||
// +build !gccgo
|
||||
// +build gc
|
||||
|
||||
#include "textflag.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build ppc64 ppc64le
|
||||
// +build !gccgo
|
||||
// +build gc
|
||||
|
||||
#include "textflag.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build riscv64
|
||||
// +build !gccgo
|
||||
// +build gc
|
||||
|
||||
#include "textflag.h"
|
||||
|
||||
|
|
|
|||
2
misc/cgo/test/testdata/issue9400/asm_s390x.s
vendored
2
misc/cgo/test/testdata/issue9400/asm_s390x.s
vendored
|
|
@ -2,7 +2,7 @@
|
|||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build !gccgo
|
||||
// +build gc
|
||||
|
||||
#include "textflag.h"
|
||||
|
||||
|
|
|
|||
24
misc/cgo/test/testx.c
Normal file
24
misc/cgo/test/testx.c
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
// Copyright 2021 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.
|
||||
|
||||
#include "_cgo_export.h"
|
||||
|
||||
void lockOSThreadC(void) {
|
||||
lockOSThreadCallback();
|
||||
}
|
||||
|
||||
void issue7978c(uint32_t *sync) {
|
||||
while(__atomic_load_n(sync, __ATOMIC_SEQ_CST) != 0)
|
||||
;
|
||||
__atomic_add_fetch(sync, 1, __ATOMIC_SEQ_CST);
|
||||
while(__atomic_load_n(sync, __ATOMIC_SEQ_CST) != 2)
|
||||
;
|
||||
issue7978cb();
|
||||
__atomic_add_fetch(sync, 1, __ATOMIC_SEQ_CST);
|
||||
while(__atomic_load_n(sync, __ATOMIC_SEQ_CST) != 6)
|
||||
;
|
||||
}
|
||||
|
||||
void f7665(void) {
|
||||
}
|
||||
|
|
@ -12,6 +12,7 @@ package cgotest
|
|||
|
||||
import (
|
||||
"runtime"
|
||||
"runtime/cgo"
|
||||
"runtime/debug"
|
||||
"strings"
|
||||
"sync"
|
||||
|
|
@ -26,7 +27,6 @@ import (
|
|||
extern void doAdd(int, int);
|
||||
|
||||
// issue 1328
|
||||
extern void BackIntoGo(void);
|
||||
void IntoC(void);
|
||||
|
||||
// issue 1560
|
||||
|
|
@ -38,11 +38,7 @@ long long mysleep(int seconds);
|
|||
long long twoSleep(int);
|
||||
|
||||
// issue 3775
|
||||
void lockOSThreadCallback(void);
|
||||
inline static void lockOSThreadC(void)
|
||||
{
|
||||
lockOSThreadCallback();
|
||||
}
|
||||
void lockOSThreadC(void);
|
||||
int usleep(unsigned usec);
|
||||
|
||||
// issue 4054 part 2 - part 1 in test.go
|
||||
|
|
@ -81,21 +77,9 @@ extern void f7665(void);
|
|||
|
||||
#include <stdint.h>
|
||||
|
||||
void issue7978cb(void);
|
||||
|
||||
// use ugly atomic variable sync since that doesn't require calling back into
|
||||
// Go code or OS dependencies
|
||||
static void issue7978c(uint32_t *sync) {
|
||||
while(__atomic_load_n(sync, __ATOMIC_SEQ_CST) != 0)
|
||||
;
|
||||
__atomic_add_fetch(sync, 1, __ATOMIC_SEQ_CST);
|
||||
while(__atomic_load_n(sync, __ATOMIC_SEQ_CST) != 2)
|
||||
;
|
||||
issue7978cb();
|
||||
__atomic_add_fetch(sync, 1, __ATOMIC_SEQ_CST);
|
||||
while(__atomic_load_n(sync, __ATOMIC_SEQ_CST) != 6)
|
||||
;
|
||||
}
|
||||
void issue7978c(uint32_t *sync);
|
||||
|
||||
// issue 8331 part 2 - part 1 in test.go
|
||||
// A typedef of an unnamed struct is the same struct when
|
||||
|
|
@ -428,9 +412,6 @@ func test6907Go(t *testing.T) {
|
|||
|
||||
// issue 7665
|
||||
|
||||
//export f7665
|
||||
func f7665() {}
|
||||
|
||||
var bad7665 unsafe.Pointer = C.f7665
|
||||
var good7665 uintptr = uintptr(C.f7665)
|
||||
|
||||
|
|
@ -558,6 +539,17 @@ func test31891(t *testing.T) {
|
|||
C.callIssue31891()
|
||||
}
|
||||
|
||||
// issue 37033, check if cgo.Handle works properly
|
||||
|
||||
var issue37033 = 42
|
||||
|
||||
//export GoFunc37033
|
||||
func GoFunc37033(handle C.uintptr_t) {
|
||||
h := cgo.Handle(handle)
|
||||
ch := h.Value().(chan int)
|
||||
ch <- issue37033
|
||||
}
|
||||
|
||||
// issue 38408
|
||||
// A typedef pointer can be used as the element type.
|
||||
// No runtime test; just make sure it compiles.
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ import (
|
|||
"debug/elf"
|
||||
"flag"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
|
|
@ -53,7 +52,7 @@ func testMain(m *testing.M) int {
|
|||
// We need a writable GOPATH in which to run the tests.
|
||||
// Construct one in a temporary directory.
|
||||
var err error
|
||||
GOPATH, err = ioutil.TempDir("", "carchive_test")
|
||||
GOPATH, err = os.MkdirTemp("", "carchive_test")
|
||||
if err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
|
|
@ -74,7 +73,7 @@ func testMain(m *testing.M) int {
|
|||
log.Panic(err)
|
||||
}
|
||||
os.Setenv("PWD", modRoot)
|
||||
if err := ioutil.WriteFile("go.mod", []byte("module testcarchive\n"), 0666); err != nil {
|
||||
if err := os.WriteFile("go.mod", []byte("module testcarchive\n"), 0666); err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
|
||||
|
|
@ -176,7 +175,7 @@ func genHeader(t *testing.T, header, dir string) {
|
|||
// The 'cgo' command generates a number of additional artifacts,
|
||||
// but we're only interested in the header.
|
||||
// Shunt the rest of the outputs to a temporary directory.
|
||||
objDir, err := ioutil.TempDir(GOPATH, "_obj")
|
||||
objDir, err := os.MkdirTemp(GOPATH, "_obj")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
|
@ -252,7 +251,7 @@ var badLineRegexp = regexp.MustCompile(`(?m)^#line [0-9]+ "/.*$`)
|
|||
// the user and make the files change based on details of the location
|
||||
// of GOPATH.
|
||||
func checkLineComments(t *testing.T, hdrname string) {
|
||||
hdr, err := ioutil.ReadFile(hdrname)
|
||||
hdr, err := os.ReadFile(hdrname)
|
||||
if err != nil {
|
||||
if !os.IsNotExist(err) {
|
||||
t.Error(err)
|
||||
|
|
@ -618,7 +617,7 @@ func TestExtar(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
s := strings.Replace(testar, "PWD", dir, 1)
|
||||
if err := ioutil.WriteFile("testar", []byte(s), 0777); err != nil {
|
||||
if err := os.WriteFile("testar", []byte(s), 0777); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
|
|
@ -776,7 +775,7 @@ func TestSIGPROF(t *testing.T) {
|
|||
// tool with -buildmode=c-archive, it passes -shared to the compiler,
|
||||
// so we override that. The go tool doesn't work this way, but Bazel
|
||||
// will likely do it in the future. And it ought to work. This test
|
||||
// was added because at one time it did not work on PPC GNU/Linux.
|
||||
// was added because at one time it did not work on PPC Linux.
|
||||
func TestCompileWithoutShared(t *testing.T) {
|
||||
// For simplicity, reuse the signal forwarding test.
|
||||
checkSignalForwardingTest(t)
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"runtime/pprof"
|
||||
)
|
||||
|
||||
|
|
@ -13,7 +13,7 @@ import "C"
|
|||
|
||||
//export go_start_profile
|
||||
func go_start_profile() {
|
||||
pprof.StartCPUProfile(ioutil.Discard)
|
||||
pprof.StartCPUProfile(io.Discard)
|
||||
}
|
||||
|
||||
//export go_stop_profile
|
||||
|
|
|
|||
2
misc/cgo/testcarchive/testdata/main_unix.c
vendored
2
misc/cgo/testcarchive/testdata/main_unix.c
vendored
|
|
@ -36,7 +36,7 @@ int install_handler() {
|
|||
return 2;
|
||||
}
|
||||
// gccgo does not set SA_ONSTACK for SIGSEGV.
|
||||
if (getenv("GCCGO") == "" && (osa.sa_flags&SA_ONSTACK) == 0) {
|
||||
if (getenv("GCCGO") == NULL && (osa.sa_flags&SA_ONSTACK) == 0) {
|
||||
fprintf(stderr, "Go runtime did not install signal handler\n");
|
||||
return 2;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ import (
|
|||
"encoding/binary"
|
||||
"flag"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
|
|
@ -125,7 +124,7 @@ func testMain(m *testing.M) int {
|
|||
// Copy testdata into GOPATH/src/testcshared, along with a go.mod file
|
||||
// declaring the same path.
|
||||
|
||||
GOPATH, err := ioutil.TempDir("", "cshared_test")
|
||||
GOPATH, err := os.MkdirTemp("", "cshared_test")
|
||||
if err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
|
|
@ -140,7 +139,7 @@ func testMain(m *testing.M) int {
|
|||
log.Panic(err)
|
||||
}
|
||||
os.Setenv("PWD", modRoot)
|
||||
if err := ioutil.WriteFile("go.mod", []byte("module testcshared\n"), 0666); err != nil {
|
||||
if err := os.WriteFile("go.mod", []byte("module testcshared\n"), 0666); err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
|
||||
|
|
@ -260,7 +259,7 @@ func createHeaders() error {
|
|||
// The 'cgo' command generates a number of additional artifacts,
|
||||
// but we're only interested in the header.
|
||||
// Shunt the rest of the outputs to a temporary directory.
|
||||
objDir, err := ioutil.TempDir("", "testcshared_obj")
|
||||
objDir, err := os.MkdirTemp("", "testcshared_obj")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
@ -381,7 +380,7 @@ func main() {
|
|||
|
||||
srcfile := filepath.Join(tmpdir, "test.go")
|
||||
objfile := filepath.Join(tmpdir, "test.dll")
|
||||
if err := ioutil.WriteFile(srcfile, []byte(prog), 0666); err != nil {
|
||||
if err := os.WriteFile(srcfile, []byte(prog), 0666); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
argv := []string{"build", "-buildmode=c-shared"}
|
||||
|
|
@ -643,7 +642,7 @@ func TestPIE(t *testing.T) {
|
|||
|
||||
// Test that installing a second time recreates the header file.
|
||||
func TestCachedInstall(t *testing.T) {
|
||||
tmpdir, err := ioutil.TempDir("", "cshared")
|
||||
tmpdir, err := os.MkdirTemp("", "cshared")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
|
@ -719,14 +718,14 @@ func TestCachedInstall(t *testing.T) {
|
|||
// copyFile copies src to dst.
|
||||
func copyFile(t *testing.T, dst, src string) {
|
||||
t.Helper()
|
||||
data, err := ioutil.ReadFile(src)
|
||||
data, err := os.ReadFile(src)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := os.MkdirAll(filepath.Dir(dst), 0777); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := ioutil.WriteFile(dst, data, 0666); err != nil {
|
||||
if err := os.WriteFile(dst, data, 0666); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
|
@ -743,7 +742,7 @@ func TestGo2C2Go(t *testing.T) {
|
|||
|
||||
t.Parallel()
|
||||
|
||||
tmpdir, err := ioutil.TempDir("", "cshared-TestGo2C2Go")
|
||||
tmpdir, err := os.MkdirTemp("", "cshared-TestGo2C2Go")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ package testgodefs
|
|||
|
||||
import (
|
||||
"bytes"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
|
|
@ -34,7 +33,7 @@ func TestGoDefs(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
gopath, err := ioutil.TempDir("", "testgodefs-gopath")
|
||||
gopath, err := os.MkdirTemp("", "testgodefs-gopath")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
|
@ -58,20 +57,20 @@ func TestGoDefs(t *testing.T) {
|
|||
t.Fatalf("%s: %v\n%s", strings.Join(cmd.Args, " "), err, cmd.Stderr)
|
||||
}
|
||||
|
||||
if err := ioutil.WriteFile(filepath.Join(dir, fp+"_defs.go"), out, 0644); err != nil {
|
||||
if err := os.WriteFile(filepath.Join(dir, fp+"_defs.go"), out, 0644); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
main, err := ioutil.ReadFile(filepath.Join("testdata", "main.go"))
|
||||
main, err := os.ReadFile(filepath.Join("testdata", "main.go"))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := ioutil.WriteFile(filepath.Join(dir, "main.go"), main, 0644); err != nil {
|
||||
if err := os.WriteFile(filepath.Join(dir, "main.go"), main, 0644); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if err := ioutil.WriteFile(filepath.Join(dir, "go.mod"), []byte("module testgodefs\ngo 1.14\n"), 0644); err != nil {
|
||||
if err := os.WriteFile(filepath.Join(dir, "go.mod"), []byte("module testgodefs\ngo 1.14\n"), 0644); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ import (
|
|||
"context"
|
||||
"flag"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
|
|
@ -31,15 +30,28 @@ func TestMain(m *testing.M) {
|
|||
os.Exit(testMain(m))
|
||||
}
|
||||
|
||||
// tmpDir is used to cleanup logged commands -- s/tmpDir/$TMPDIR/
|
||||
var tmpDir string
|
||||
|
||||
// prettyPrintf prints lines with tmpDir sanitized.
|
||||
func prettyPrintf(format string, args ...interface{}) {
|
||||
s := fmt.Sprintf(format, args...)
|
||||
if tmpDir != "" {
|
||||
s = strings.ReplaceAll(s, tmpDir, "$TMPDIR")
|
||||
}
|
||||
fmt.Print(s)
|
||||
}
|
||||
|
||||
func testMain(m *testing.M) int {
|
||||
// Copy testdata into GOPATH/src/testplugin, along with a go.mod file
|
||||
// declaring the same path.
|
||||
|
||||
GOPATH, err := ioutil.TempDir("", "plugin_test")
|
||||
GOPATH, err := os.MkdirTemp("", "plugin_test")
|
||||
if err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
defer os.RemoveAll(GOPATH)
|
||||
tmpDir = GOPATH
|
||||
|
||||
modRoot := filepath.Join(GOPATH, "src", "testplugin")
|
||||
altRoot := filepath.Join(GOPATH, "alt", "src", "testplugin")
|
||||
|
|
@ -50,14 +62,20 @@ func testMain(m *testing.M) int {
|
|||
if err := overlayDir(dstRoot, srcRoot); err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
if err := ioutil.WriteFile(filepath.Join(dstRoot, "go.mod"), []byte("module testplugin\n"), 0666); err != nil {
|
||||
prettyPrintf("mkdir -p %s\n", dstRoot)
|
||||
prettyPrintf("rsync -a %s/ %s\n", srcRoot, dstRoot)
|
||||
|
||||
if err := os.WriteFile(filepath.Join(dstRoot, "go.mod"), []byte("module testplugin\n"), 0666); err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
prettyPrintf("echo 'module testplugin' > %s/go.mod\n", dstRoot)
|
||||
}
|
||||
|
||||
os.Setenv("GOPATH", filepath.Join(GOPATH, "alt"))
|
||||
if err := os.Chdir(altRoot); err != nil {
|
||||
log.Panic(err)
|
||||
} else {
|
||||
prettyPrintf("cd %s\n", altRoot)
|
||||
}
|
||||
os.Setenv("PWD", altRoot)
|
||||
goCmd(nil, "build", "-buildmode=plugin", "-o", filepath.Join(modRoot, "plugin-mismatch.so"), "./plugin-mismatch")
|
||||
|
|
@ -65,6 +83,8 @@ func testMain(m *testing.M) int {
|
|||
os.Setenv("GOPATH", GOPATH)
|
||||
if err := os.Chdir(modRoot); err != nil {
|
||||
log.Panic(err)
|
||||
} else {
|
||||
prettyPrintf("cd %s\n", modRoot)
|
||||
}
|
||||
os.Setenv("PWD", modRoot)
|
||||
|
||||
|
|
@ -72,13 +92,14 @@ func testMain(m *testing.M) int {
|
|||
|
||||
goCmd(nil, "build", "-buildmode=plugin", "./plugin1")
|
||||
goCmd(nil, "build", "-buildmode=plugin", "./plugin2")
|
||||
so, err := ioutil.ReadFile("plugin2.so")
|
||||
so, err := os.ReadFile("plugin2.so")
|
||||
if err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
if err := ioutil.WriteFile("plugin2-dup.so", so, 0444); err != nil {
|
||||
if err := os.WriteFile("plugin2-dup.so", so, 0444); err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
prettyPrintf("cp plugin2.so plugin2-dup.so\n")
|
||||
|
||||
goCmd(nil, "build", "-buildmode=plugin", "-o=sub/plugin1.so", "./sub/plugin1")
|
||||
goCmd(nil, "build", "-buildmode=plugin", "-o=unnamed1.so", "./unnamed1/main.go")
|
||||
|
|
@ -95,8 +116,53 @@ func goCmd(t *testing.T, op string, args ...string) {
|
|||
run(t, "go", append([]string{op, "-gcflags", gcflags}, args...)...)
|
||||
}
|
||||
|
||||
// escape converts a string to something suitable for a shell command line.
|
||||
func escape(s string) string {
|
||||
s = strings.Replace(s, "\\", "\\\\", -1)
|
||||
s = strings.Replace(s, "'", "\\'", -1)
|
||||
// Conservative guess at characters that will force quoting
|
||||
if s == "" || strings.ContainsAny(s, "\\ ;#*&$~?!|[]()<>{}`") {
|
||||
s = "'" + s + "'"
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
// asCommandLine renders cmd as something that could be copy-and-pasted into a command line
|
||||
func asCommandLine(cwd string, cmd *exec.Cmd) string {
|
||||
s := "("
|
||||
if cmd.Dir != "" && cmd.Dir != cwd {
|
||||
s += "cd" + escape(cmd.Dir) + ";"
|
||||
}
|
||||
for _, e := range cmd.Env {
|
||||
if !strings.HasPrefix(e, "PATH=") &&
|
||||
!strings.HasPrefix(e, "HOME=") &&
|
||||
!strings.HasPrefix(e, "USER=") &&
|
||||
!strings.HasPrefix(e, "SHELL=") {
|
||||
s += " "
|
||||
s += escape(e)
|
||||
}
|
||||
}
|
||||
// These EVs are relevant to this test.
|
||||
for _, e := range os.Environ() {
|
||||
if strings.HasPrefix(e, "PWD=") ||
|
||||
strings.HasPrefix(e, "GOPATH=") ||
|
||||
strings.HasPrefix(e, "LD_LIBRARY_PATH=") {
|
||||
s += " "
|
||||
s += escape(e)
|
||||
}
|
||||
}
|
||||
for _, a := range cmd.Args {
|
||||
s += " "
|
||||
s += escape(a)
|
||||
}
|
||||
s += " )"
|
||||
return s
|
||||
}
|
||||
|
||||
func run(t *testing.T, bin string, args ...string) string {
|
||||
cmd := exec.Command(bin, args...)
|
||||
cmdLine := asCommandLine(".", cmd)
|
||||
prettyPrintf("%s\n", cmdLine)
|
||||
cmd.Stderr = new(strings.Builder)
|
||||
out, err := cmd.Output()
|
||||
if err != nil {
|
||||
|
|
@ -201,12 +267,18 @@ func TestMethod(t *testing.T) {
|
|||
// Exported symbol's method must be live.
|
||||
goCmd(t, "build", "-buildmode=plugin", "-o", "plugin.so", "./method/plugin.go")
|
||||
goCmd(t, "build", "-o", "method.exe", "./method/main.go")
|
||||
run(t, "./method.exe")
|
||||
}
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
||||
defer cancel()
|
||||
cmd := exec.CommandContext(ctx, "./method.exe")
|
||||
out, err := cmd.CombinedOutput()
|
||||
if err != nil {
|
||||
t.Fatalf("%s: %v\n%s", strings.Join(cmd.Args, " "), err, out)
|
||||
func TestMethod2(t *testing.T) {
|
||||
goCmd(t, "build", "-buildmode=plugin", "-o", "method2.so", "./method2/plugin.go")
|
||||
goCmd(t, "build", "-o", "method2.exe", "./method2/main.go")
|
||||
run(t, "./method2.exe")
|
||||
}
|
||||
|
||||
func TestIssue44956(t *testing.T) {
|
||||
goCmd(t, "build", "-buildmode=plugin", "-o", "issue44956p1.so", "./issue44956/plugin1.go")
|
||||
goCmd(t, "build", "-buildmode=plugin", "-o", "issue44956p2.so", "./issue44956/plugin2.go")
|
||||
goCmd(t, "build", "-o", "issue44956.exe", "./issue44956/main.go")
|
||||
run(t, "./issue44956.exe")
|
||||
}
|
||||
|
|
|
|||
7
misc/cgo/testplugin/testdata/issue44956/base/base.go
vendored
Normal file
7
misc/cgo/testplugin/testdata/issue44956/base/base.go
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
// Copyright 2021 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.
|
||||
|
||||
package base
|
||||
|
||||
var X = &map[int]int{123: 456}
|
||||
47
misc/cgo/testplugin/testdata/issue44956/main.go
vendored
Normal file
47
misc/cgo/testplugin/testdata/issue44956/main.go
vendored
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
// Copyright 2021 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.
|
||||
|
||||
// Issue 44956: writable static temp is not exported correctly.
|
||||
// In the test below, package base is
|
||||
//
|
||||
// X = &map{...}
|
||||
//
|
||||
// which compiles to
|
||||
//
|
||||
// X = &stmp // static
|
||||
// stmp = makemap(...) // in init function
|
||||
//
|
||||
// plugin1 and plugin2 both import base. plugin1 doesn't use
|
||||
// base.X, so that symbol is deadcoded in plugin1.
|
||||
//
|
||||
// plugin1 is loaded first. base.init runs at that point, which
|
||||
// initialize base.stmp.
|
||||
//
|
||||
// plugin2 is then loaded. base.init already ran, so it doesn't run
|
||||
// again. When base.stmp is not exported, plugin2's base.X points to
|
||||
// its own private base.stmp, which is not initialized, fail.
|
||||
|
||||
package main
|
||||
|
||||
import "plugin"
|
||||
|
||||
func main() {
|
||||
_, err := plugin.Open("issue44956p1.so")
|
||||
if err != nil {
|
||||
panic("FAIL")
|
||||
}
|
||||
|
||||
p2, err := plugin.Open("issue44956p2.so")
|
||||
if err != nil {
|
||||
panic("FAIL")
|
||||
}
|
||||
f, err := p2.Lookup("F")
|
||||
if err != nil {
|
||||
panic("FAIL")
|
||||
}
|
||||
x := f.(func() *map[int]int)()
|
||||
if x == nil || (*x)[123] != 456 {
|
||||
panic("FAIL")
|
||||
}
|
||||
}
|
||||
9
misc/cgo/testplugin/testdata/issue44956/plugin1.go
vendored
Normal file
9
misc/cgo/testplugin/testdata/issue44956/plugin1.go
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
// Copyright 2021 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.
|
||||
|
||||
package main
|
||||
|
||||
import _ "testplugin/issue44956/base"
|
||||
|
||||
func main() {}
|
||||
|
|
@ -1,10 +1,11 @@
|
|||
// runindir -gcflags=-c=1
|
||||
// +build !windows
|
||||
|
||||
// Copyright 2021 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.
|
||||
|
||||
// TODO May delete or adapt this test once regabi is the default
|
||||
package main
|
||||
|
||||
package ignore
|
||||
import "testplugin/issue44956/base"
|
||||
|
||||
func F() *map[int]int { return base.X }
|
||||
|
||||
func main() {}
|
||||
32
misc/cgo/testplugin/testdata/method2/main.go
vendored
Normal file
32
misc/cgo/testplugin/testdata/method2/main.go
vendored
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
// Copyright 2021 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.
|
||||
|
||||
// A type can be passed to a plugin and converted to interface
|
||||
// there. So its methods need to be live.
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"plugin"
|
||||
|
||||
"testplugin/method2/p"
|
||||
)
|
||||
|
||||
var t p.T
|
||||
|
||||
type I interface{ M() }
|
||||
|
||||
func main() {
|
||||
pl, err := plugin.Open("method2.so")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
f, err := pl.Lookup("F")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
f.(func(p.T) interface{})(t).(I).M()
|
||||
}
|
||||
9
misc/cgo/testplugin/testdata/method2/p/p.go
vendored
Normal file
9
misc/cgo/testplugin/testdata/method2/p/p.go
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
// Copyright 2021 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.
|
||||
|
||||
package p
|
||||
|
||||
type T int
|
||||
|
||||
func (T) M() { println("M") }
|
||||
11
misc/cgo/testplugin/testdata/method2/plugin.go
vendored
Normal file
11
misc/cgo/testplugin/testdata/method2/plugin.go
vendored
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
// Copyright 2021 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.
|
||||
|
||||
package main
|
||||
|
||||
import "testplugin/method2/p"
|
||||
|
||||
func main() {}
|
||||
|
||||
func F(t p.T) interface{} { return t }
|
||||
|
|
@ -11,7 +11,6 @@ import (
|
|||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
|
|
@ -36,7 +35,7 @@ func requireOvercommit(t *testing.T) {
|
|||
|
||||
overcommit.Once.Do(func() {
|
||||
var out []byte
|
||||
out, overcommit.err = ioutil.ReadFile("/proc/sys/vm/overcommit_memory")
|
||||
out, overcommit.err = os.ReadFile("/proc/sys/vm/overcommit_memory")
|
||||
if overcommit.err != nil {
|
||||
return
|
||||
}
|
||||
|
|
@ -313,14 +312,14 @@ int main() {
|
|||
`)
|
||||
|
||||
func (c *config) checkCSanitizer() (skip bool, err error) {
|
||||
dir, err := ioutil.TempDir("", c.sanitizer)
|
||||
dir, err := os.MkdirTemp("", c.sanitizer)
|
||||
if err != nil {
|
||||
return false, fmt.Errorf("failed to create temp directory: %v", err)
|
||||
}
|
||||
defer os.RemoveAll(dir)
|
||||
|
||||
src := filepath.Join(dir, "return0.c")
|
||||
if err := ioutil.WriteFile(src, cMain, 0600); err != nil {
|
||||
if err := os.WriteFile(src, cMain, 0600); err != nil {
|
||||
return false, fmt.Errorf("failed to write C source file: %v", err)
|
||||
}
|
||||
|
||||
|
|
@ -418,7 +417,7 @@ func (d *tempDir) Join(name string) string {
|
|||
|
||||
func newTempDir(t *testing.T) *tempDir {
|
||||
t.Helper()
|
||||
dir, err := ioutil.TempDir("", filepath.Dir(t.Name()))
|
||||
dir, err := os.MkdirTemp("", filepath.Dir(t.Name()))
|
||||
if err != nil {
|
||||
t.Fatalf("Failed to create temp dir: %v", err)
|
||||
}
|
||||
|
|
@ -440,3 +439,14 @@ func hangProneCmd(name string, arg ...string) *exec.Cmd {
|
|||
}
|
||||
return cmd
|
||||
}
|
||||
|
||||
// mSanSupported is a copy of the function cmd/internal/sys.MSanSupported,
|
||||
// because the internal pacakage can't be used here.
|
||||
func mSanSupported(goos, goarch string) bool {
|
||||
switch goos {
|
||||
case "linux":
|
||||
return goarch == "amd64" || goarch == "arm64"
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ package sanitizers_test
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
|
@ -19,6 +19,12 @@ func TestShared(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
GOARCH, err := goEnv("GOARCH")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
libExt := "so"
|
||||
if GOOS == "darwin" {
|
||||
libExt = "dylib"
|
||||
|
|
@ -41,6 +47,11 @@ func TestShared(t *testing.T) {
|
|||
for _, tc := range cases {
|
||||
tc := tc
|
||||
name := strings.TrimSuffix(tc.src, ".go")
|
||||
//The memory sanitizer tests require support for the -msan option.
|
||||
if tc.sanitizer == "memory" && !mSanSupported(GOOS, GOARCH) {
|
||||
t.Logf("skipping %s test on %s/%s; -msan option is not supported.", name, GOOS, GOARCH)
|
||||
continue
|
||||
}
|
||||
t.Run(name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
config := configure(tc.sanitizer)
|
||||
|
|
@ -53,7 +64,7 @@ func TestShared(t *testing.T) {
|
|||
mustRun(t, config.goCmd("build", "-buildmode=c-shared", "-o", lib, srcPath(tc.src)))
|
||||
|
||||
cSrc := dir.Join("main.c")
|
||||
if err := ioutil.WriteFile(cSrc, cMain, 0600); err != nil {
|
||||
if err := os.WriteFile(cSrc, cMain, 0600); err != nil {
|
||||
t.Fatalf("failed to write C source file: %v", err)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,19 @@ import (
|
|||
)
|
||||
|
||||
func TestMSAN(t *testing.T) {
|
||||
goos, err := goEnv("GOOS")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
goarch, err := goEnv("GOARCH")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
// The msan tests require support for the -msan option.
|
||||
if !mSanSupported(goos, goarch) {
|
||||
t.Skipf("skipping on %s/%s; -msan option is not supported.", goos, goarch)
|
||||
}
|
||||
|
||||
t.Parallel()
|
||||
requireOvercommit(t)
|
||||
config := configure("memory")
|
||||
|
|
|
|||
4
misc/cgo/testsanitizers/testdata/tsan9.go
vendored
4
misc/cgo/testsanitizers/testdata/tsan9.go
vendored
|
|
@ -44,7 +44,7 @@ void spin() {
|
|||
import "C"
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"runtime/pprof"
|
||||
"time"
|
||||
)
|
||||
|
|
@ -60,7 +60,7 @@ func goSpin() {
|
|||
}
|
||||
|
||||
func main() {
|
||||
pprof.StartCPUProfile(ioutil.Discard)
|
||||
pprof.StartCPUProfile(io.Discard)
|
||||
go C.spin()
|
||||
goSpin()
|
||||
pprof.StopCPUProfile()
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ import (
|
|||
"fmt"
|
||||
"go/build"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
|
|
@ -90,7 +89,7 @@ func goCmd(t *testing.T, args ...string) string {
|
|||
|
||||
// TestMain calls testMain so that the latter can use defer (TestMain exits with os.Exit).
|
||||
func testMain(m *testing.M) (int, error) {
|
||||
workDir, err := ioutil.TempDir("", "shared_test")
|
||||
workDir, err := os.MkdirTemp("", "shared_test")
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
|
@ -177,7 +176,7 @@ func cloneTestdataModule(gopath string) (string, error) {
|
|||
if err := overlayDir(modRoot, "testdata"); err != nil {
|
||||
return "", err
|
||||
}
|
||||
if err := ioutil.WriteFile(filepath.Join(modRoot, "go.mod"), []byte("module testshared\n"), 0644); err != nil {
|
||||
if err := os.WriteFile(filepath.Join(modRoot, "go.mod"), []byte("module testshared\n"), 0644); err != nil {
|
||||
return "", err
|
||||
}
|
||||
return modRoot, nil
|
||||
|
|
@ -318,7 +317,7 @@ func TestShlibnameFiles(t *testing.T) {
|
|||
}
|
||||
for _, pkg := range pkgs {
|
||||
shlibnamefile := filepath.Join(gorootInstallDir, pkg+".shlibname")
|
||||
contentsb, err := ioutil.ReadFile(shlibnamefile)
|
||||
contentsb, err := os.ReadFile(shlibnamefile)
|
||||
if err != nil {
|
||||
t.Errorf("error reading shlibnamefile for %s: %v", pkg, err)
|
||||
continue
|
||||
|
|
@ -791,7 +790,7 @@ func resetFileStamps() {
|
|||
// It also sets the time of the file, so that we can see if it is rewritten.
|
||||
func touch(t *testing.T, path string) (cleanup func()) {
|
||||
t.Helper()
|
||||
data, err := ioutil.ReadFile(path)
|
||||
data, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
|
@ -837,14 +836,14 @@ func touch(t *testing.T, path string) (cleanup func()) {
|
|||
// user-writable.
|
||||
perm := fi.Mode().Perm() | 0200
|
||||
|
||||
if err := ioutil.WriteFile(path, data, perm); err != nil {
|
||||
if err := os.WriteFile(path, data, perm); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := os.Chtimes(path, nearlyNew, nearlyNew); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
return func() {
|
||||
if err := ioutil.WriteFile(path, old, perm); err != nil {
|
||||
if err := os.WriteFile(path, old, perm); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
2
misc/cgo/testshared/testdata/depBase/asm.s
vendored
2
misc/cgo/testshared/testdata/depBase/asm.s
vendored
|
|
@ -2,7 +2,7 @@
|
|||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build !gccgo
|
||||
// +build gc
|
||||
|
||||
#include "textflag.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build !gccgo
|
||||
// +build gc
|
||||
|
||||
package depBase
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@
|
|||
package so_test
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
|
|
@ -37,7 +36,7 @@ func requireTestSOSupported(t *testing.T) {
|
|||
func TestSO(t *testing.T) {
|
||||
requireTestSOSupported(t)
|
||||
|
||||
GOPATH, err := ioutil.TempDir("", "cgosotest")
|
||||
GOPATH, err := os.MkdirTemp("", "cgosotest")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
|
@ -47,7 +46,7 @@ func TestSO(t *testing.T) {
|
|||
if err := overlayDir(modRoot, "testdata"); err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
if err := ioutil.WriteFile(filepath.Join(modRoot, "go.mod"), []byte("module cgosotest\n"), 0666); err != nil {
|
||||
if err := os.WriteFile(filepath.Join(modRoot, "go.mod"), []byte("module cgosotest\n"), 0666); err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
|
||||
|
|
@ -80,6 +79,10 @@ func TestSO(t *testing.T) {
|
|||
case "windows":
|
||||
ext = "dll"
|
||||
args = append(args, "-DEXPORT_DLL")
|
||||
// At least in mingw-clang it is not permitted to just name a .dll
|
||||
// on the command line. You must name the corresponding import
|
||||
// library instead, even though the dll is used when the executable is run.
|
||||
args = append(args, "-Wl,-out-implib,libcgosotest.a")
|
||||
case "aix":
|
||||
ext = "so.1"
|
||||
}
|
||||
|
|
|
|||
2
misc/cgo/testso/testdata/cgoso.go
vendored
2
misc/cgo/testso/testdata/cgoso.go
vendored
|
|
@ -14,7 +14,7 @@ package cgosotest
|
|||
#cgo solaris LDFLAGS: -L. -lcgosotest
|
||||
#cgo netbsd LDFLAGS: -L. libcgosotest.so
|
||||
#cgo darwin LDFLAGS: -L. libcgosotest.dylib
|
||||
#cgo windows LDFLAGS: -L. libcgosotest.dll
|
||||
#cgo windows LDFLAGS: -L. libcgosotest.a
|
||||
#cgo aix LDFLAGS: -L. -l cgosotest
|
||||
|
||||
void init(void);
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@
|
|||
package so_test
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
|
|
@ -37,7 +36,7 @@ func requireTestSOSupported(t *testing.T) {
|
|||
func TestSO(t *testing.T) {
|
||||
requireTestSOSupported(t)
|
||||
|
||||
GOPATH, err := ioutil.TempDir("", "cgosotest")
|
||||
GOPATH, err := os.MkdirTemp("", "cgosotest")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
|
@ -47,7 +46,7 @@ func TestSO(t *testing.T) {
|
|||
if err := overlayDir(modRoot, "testdata"); err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
if err := ioutil.WriteFile(filepath.Join(modRoot, "go.mod"), []byte("module cgosotest\n"), 0666); err != nil {
|
||||
if err := os.WriteFile(filepath.Join(modRoot, "go.mod"), []byte("module cgosotest\n"), 0666); err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
|
||||
|
|
@ -80,6 +79,10 @@ func TestSO(t *testing.T) {
|
|||
case "windows":
|
||||
ext = "dll"
|
||||
args = append(args, "-DEXPORT_DLL")
|
||||
// At least in mingw-clang it is not permitted to just name a .dll
|
||||
// on the command line. You must name the corresponding import
|
||||
// library instead, even though the dll is used when the executable is run.
|
||||
args = append(args, "-Wl,-out-implib,libcgosotest.a")
|
||||
case "aix":
|
||||
ext = "so.1"
|
||||
}
|
||||
|
|
|
|||
2
misc/cgo/testsovar/testdata/cgoso.go
vendored
2
misc/cgo/testsovar/testdata/cgoso.go
vendored
|
|
@ -18,7 +18,7 @@ package cgosotest
|
|||
#cgo solaris LDFLAGS: -L. -lcgosotest
|
||||
#cgo netbsd LDFLAGS: -L. libcgosotest.so
|
||||
#cgo darwin LDFLAGS: -L. libcgosotest.dylib
|
||||
#cgo windows LDFLAGS: -L. libcgosotest.dll
|
||||
#cgo windows LDFLAGS: -L. libcgosotest.a
|
||||
#cgo aix LDFLAGS: -L. -l cgosotest
|
||||
|
||||
#include "cgoso_c.h"
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
<a href="#" url="https://golang.org/pkg/">pkg</a> id/name:</small>
|
||||
<form style='margin: 0' id='navform'><nobr><input id="inputbox" size=10 tabindex=1 /><input type="submit" value="go" /></nobr></form>
|
||||
<small>Also: <a href="#" url="https://build.golang.org">buildbots</a>
|
||||
<a href="#" url="https://github.com/golang/go">Github</a>
|
||||
<a href="#" url="https://github.com/golang/go">GitHub</a>
|
||||
</small>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ import (
|
|||
"bytes"
|
||||
"crypto/x509"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
"strings"
|
||||
|
|
@ -38,7 +37,7 @@ func main() {
|
|||
fmt.Println("# will be overwritten when running Go programs.")
|
||||
for _, mp := range mps {
|
||||
fmt.Println()
|
||||
f, err := ioutil.TempFile("", "go_ios_detect_")
|
||||
f, err := os.CreateTemp("", "go_ios_detect_")
|
||||
check(err)
|
||||
fname := f.Name()
|
||||
defer os.Remove(fname)
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@ import (
|
|||
"fmt"
|
||||
"go/build"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"net"
|
||||
"os"
|
||||
|
|
@ -79,7 +78,7 @@ func main() {
|
|||
|
||||
func runMain() (int, error) {
|
||||
var err error
|
||||
tmpdir, err = ioutil.TempDir("", "go_ios_exec_")
|
||||
tmpdir, err = os.MkdirTemp("", "go_ios_exec_")
|
||||
if err != nil {
|
||||
return 1, err
|
||||
}
|
||||
|
|
@ -205,13 +204,13 @@ func assembleApp(appdir, bin string) error {
|
|||
}
|
||||
|
||||
entitlementsPath := filepath.Join(tmpdir, "Entitlements.plist")
|
||||
if err := ioutil.WriteFile(entitlementsPath, []byte(entitlementsPlist()), 0744); err != nil {
|
||||
if err := os.WriteFile(entitlementsPath, []byte(entitlementsPlist()), 0744); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := ioutil.WriteFile(filepath.Join(appdir, "Info.plist"), []byte(infoPlist(pkgpath)), 0744); err != nil {
|
||||
if err := os.WriteFile(filepath.Join(appdir, "Info.plist"), []byte(infoPlist(pkgpath)), 0744); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := ioutil.WriteFile(filepath.Join(appdir, "ResourceRules.plist"), []byte(resourceRules), 0744); err != nil {
|
||||
if err := os.WriteFile(filepath.Join(appdir, "ResourceRules.plist"), []byte(resourceRules), 0744); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import (
|
|||
"errors"
|
||||
"flag"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
|
|
@ -144,7 +144,7 @@ func doCrawl(url string) error {
|
|||
if res.StatusCode != 200 {
|
||||
return errors.New(res.Status)
|
||||
}
|
||||
slurp, err := ioutil.ReadAll(res.Body)
|
||||
slurp, err := io.ReadAll(res.Body)
|
||||
res.Body.Close()
|
||||
if err != nil {
|
||||
log.Fatalf("Error reading %s body: %v", url, err)
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ package reboot_test
|
|||
|
||||
import (
|
||||
"bytes"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
|
|
@ -23,7 +22,7 @@ import (
|
|||
|
||||
func TestExperimentToolID(t *testing.T) {
|
||||
// Set up GOROOT
|
||||
goroot, err := ioutil.TempDir("", "experiment-goroot")
|
||||
goroot, err := os.MkdirTemp("", "experiment-goroot")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
|
@ -34,13 +33,13 @@ func TestExperimentToolID(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if err := ioutil.WriteFile(filepath.Join(goroot, "VERSION"), []byte("go1.999"), 0666); err != nil {
|
||||
if err := os.WriteFile(filepath.Join(goroot, "VERSION"), []byte("go1.999"), 0666); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
env := append(os.Environ(), "GOROOT=", "GOROOT_BOOTSTRAP="+runtime.GOROOT())
|
||||
|
||||
// Use a clean cache.
|
||||
gocache, err := ioutil.TempDir("", "experiment-gocache")
|
||||
gocache, err := os.MkdirTemp("", "experiment-gocache")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@
|
|||
package reboot_test
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
|
|
@ -16,7 +15,7 @@ import (
|
|||
)
|
||||
|
||||
func TestRepeatBootstrap(t *testing.T) {
|
||||
goroot, err := ioutil.TempDir("", "reboot-goroot")
|
||||
goroot, err := os.MkdirTemp("", "reboot-goroot")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
|
@ -27,7 +26,7 @@ func TestRepeatBootstrap(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if err := ioutil.WriteFile(filepath.Join(goroot, "VERSION"), []byte(runtime.Version()), 0666); err != nil {
|
||||
if err := os.WriteFile(filepath.Join(goroot, "VERSION"), []byte(runtime.Version()), 0666); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -993,13 +993,13 @@
|
|||
</style>
|
||||
<div style="padding-right: 200px">
|
||||
<div style="float:right; border-style: solid; border-width: 1px; padding:20px">
|
||||
X no feedback<br/>
|
||||
0 uninitialized<br/>
|
||||
. premonomorphic<br/>
|
||||
1 monomorphic<br/>
|
||||
^ recompute handler<br/>
|
||||
P polymorphic<br/>
|
||||
N megamorphic<br/>
|
||||
X no feedback<br>
|
||||
0 uninitialized<br>
|
||||
. premonomorphic<br>
|
||||
1 monomorphic<br>
|
||||
^ recompute handler<br>
|
||||
P polymorphic<br>
|
||||
N megamorphic<br>
|
||||
G generic
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -3596,7 +3596,7 @@
|
|||
<div id="pipeline_per_frame_container">
|
||||
<div class="subtitle">Graphics Pipeline and Raster Tasks</div>
|
||||
<div class="description">
|
||||
When raster tasks are completed in comparison to the rest of the graphics pipeline.<br/>
|
||||
When raster tasks are completed in comparison to the rest of the graphics pipeline.<br>
|
||||
Only pages where raster tasks are completed after beginFrame is issued are included.
|
||||
</div>
|
||||
<tr-v-ui-raster-visualization id="rasterVisualization">
|
||||
|
|
|
|||
|
|
@ -296,8 +296,8 @@
|
|||
setInt64(sp + 8, (timeOrigin + performance.now()) * 1000000);
|
||||
},
|
||||
|
||||
// func walltime1() (sec int64, nsec int32)
|
||||
"runtime.walltime1": (sp) => {
|
||||
// func walltime() (sec int64, nsec int32)
|
||||
"runtime.walltime": (sp) => {
|
||||
sp >>>= 0;
|
||||
const msec = (new Date).getTime();
|
||||
setInt64(sp + 8, msec / 1000);
|
||||
|
|
|
|||
|
|
@ -1,2 +0,0 @@
|
|||
User-agent: *
|
||||
Disallow: /
|
||||
|
|
@ -2,6 +2,7 @@
|
|||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build aix || linux || dragonfly || openbsd || solaris
|
||||
// +build aix linux dragonfly openbsd solaris
|
||||
|
||||
package tar
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build darwin || freebsd || netbsd
|
||||
// +build darwin freebsd netbsd
|
||||
|
||||
package tar
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build aix || linux || darwin || dragonfly || freebsd || openbsd || netbsd || solaris
|
||||
// +build aix linux darwin dragonfly freebsd openbsd netbsd solaris
|
||||
|
||||
package tar
|
||||
|
|
|
|||
|
|
@ -262,16 +262,11 @@ func TestFileInfoHeaderDir(t *testing.T) {
|
|||
func TestFileInfoHeaderSymlink(t *testing.T) {
|
||||
testenv.MustHaveSymlink(t)
|
||||
|
||||
tmpdir, err := os.MkdirTemp("", "TestFileInfoHeaderSymlink")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer os.RemoveAll(tmpdir)
|
||||
tmpdir := t.TempDir()
|
||||
|
||||
link := filepath.Join(tmpdir, "link")
|
||||
target := tmpdir
|
||||
err = os.Symlink(target, link)
|
||||
if err != nil {
|
||||
if err := os.Symlink(target, link); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
fi, err := os.Lstat(link)
|
||||
|
|
|
|||
|
|
@ -52,12 +52,9 @@ type File struct {
|
|||
FileHeader
|
||||
zip *Reader
|
||||
zipr io.ReaderAt
|
||||
zipsize int64
|
||||
headerOffset int64
|
||||
}
|
||||
|
||||
func (f *File) hasDataDescriptor() bool {
|
||||
return f.Flags&0x8 != 0
|
||||
zip64 bool // zip64 extended information extra field presence
|
||||
descErr error // error reading the data descriptor during init
|
||||
}
|
||||
|
||||
// OpenReader will open the Zip file specified by name and return a ReadCloser.
|
||||
|
|
@ -112,7 +109,7 @@ func (z *Reader) init(r io.ReaderAt, size int64) error {
|
|||
// a bad one, and then only report an ErrFormat or UnexpectedEOF if
|
||||
// the file count modulo 65536 is incorrect.
|
||||
for {
|
||||
f := &File{zip: z, zipr: r, zipsize: size}
|
||||
f := &File{zip: z, zipr: r}
|
||||
err = readDirectoryHeader(f, buf)
|
||||
if err == ErrFormat || err == io.ErrUnexpectedEOF {
|
||||
break
|
||||
|
|
@ -120,6 +117,7 @@ func (z *Reader) init(r io.ReaderAt, size int64) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
f.readDataDescriptor()
|
||||
z.File = append(z.File, f)
|
||||
}
|
||||
if uint16(len(z.File)) != uint16(end.directoryRecords) { // only compare 16 bits here
|
||||
|
|
@ -180,25 +178,67 @@ func (f *File) Open() (io.ReadCloser, error) {
|
|||
return nil, ErrAlgorithm
|
||||
}
|
||||
var rc io.ReadCloser = dcomp(r)
|
||||
var desr io.Reader
|
||||
if f.hasDataDescriptor() {
|
||||
desr = io.NewSectionReader(f.zipr, f.headerOffset+bodyOffset+size, dataDescriptorLen)
|
||||
}
|
||||
rc = &checksumReader{
|
||||
rc: rc,
|
||||
hash: crc32.NewIEEE(),
|
||||
f: f,
|
||||
desr: desr,
|
||||
}
|
||||
return rc, nil
|
||||
}
|
||||
|
||||
// OpenRaw returns a Reader that provides access to the File's contents without
|
||||
// decompression.
|
||||
func (f *File) OpenRaw() (io.Reader, error) {
|
||||
bodyOffset, err := f.findBodyOffset()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
r := io.NewSectionReader(f.zipr, f.headerOffset+bodyOffset, int64(f.CompressedSize64))
|
||||
return r, nil
|
||||
}
|
||||
|
||||
func (f *File) readDataDescriptor() {
|
||||
if !f.hasDataDescriptor() {
|
||||
return
|
||||
}
|
||||
|
||||
bodyOffset, err := f.findBodyOffset()
|
||||
if err != nil {
|
||||
f.descErr = err
|
||||
return
|
||||
}
|
||||
|
||||
// In section 4.3.9.2 of the spec: "However ZIP64 format MAY be used
|
||||
// regardless of the size of a file. When extracting, if the zip64
|
||||
// extended information extra field is present for the file the
|
||||
// compressed and uncompressed sizes will be 8 byte values."
|
||||
//
|
||||
// Historically, this package has used the compressed and uncompressed
|
||||
// sizes from the central directory to determine if the package is
|
||||
// zip64.
|
||||
//
|
||||
// For this case we allow either the extra field or sizes to determine
|
||||
// the data descriptor length.
|
||||
zip64 := f.zip64 || f.isZip64()
|
||||
n := int64(dataDescriptorLen)
|
||||
if zip64 {
|
||||
n = dataDescriptor64Len
|
||||
}
|
||||
size := int64(f.CompressedSize64)
|
||||
r := io.NewSectionReader(f.zipr, f.headerOffset+bodyOffset+size, n)
|
||||
dd, err := readDataDescriptor(r, zip64)
|
||||
if err != nil {
|
||||
f.descErr = err
|
||||
return
|
||||
}
|
||||
f.CRC32 = dd.crc32
|
||||
}
|
||||
|
||||
type checksumReader struct {
|
||||
rc io.ReadCloser
|
||||
hash hash.Hash32
|
||||
nread uint64 // number of bytes read so far
|
||||
f *File
|
||||
desr io.Reader // if non-nil, where to read the data descriptor
|
||||
err error // sticky error
|
||||
}
|
||||
|
||||
|
|
@ -220,12 +260,12 @@ func (r *checksumReader) Read(b []byte) (n int, err error) {
|
|||
if r.nread != r.f.UncompressedSize64 {
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
if r.desr != nil {
|
||||
if err1 := readDataDescriptor(r.desr, r.f); err1 != nil {
|
||||
if err1 == io.EOF {
|
||||
if r.f.hasDataDescriptor() {
|
||||
if r.f.descErr != nil {
|
||||
if r.f.descErr == io.EOF {
|
||||
err = io.ErrUnexpectedEOF
|
||||
} else {
|
||||
err = err1
|
||||
err = r.f.descErr
|
||||
}
|
||||
} else if r.hash.Sum32() != r.f.CRC32 {
|
||||
err = ErrChecksum
|
||||
|
|
@ -336,6 +376,8 @@ parseExtras:
|
|||
|
||||
switch fieldTag {
|
||||
case zip64ExtraID:
|
||||
f.zip64 = true
|
||||
|
||||
// update directory values from the zip64 extra block.
|
||||
// They should only be consulted if the sizes read earlier
|
||||
// are maxed out.
|
||||
|
|
@ -435,8 +477,9 @@ parseExtras:
|
|||
return nil
|
||||
}
|
||||
|
||||
func readDataDescriptor(r io.Reader, f *File) error {
|
||||
var buf [dataDescriptorLen]byte
|
||||
func readDataDescriptor(r io.Reader, zip64 bool) (*dataDescriptor, error) {
|
||||
// Create enough space for the largest possible size
|
||||
var buf [dataDescriptor64Len]byte
|
||||
|
||||
// The spec says: "Although not originally assigned a
|
||||
// signature, the value 0x08074b50 has commonly been adopted
|
||||
|
|
@ -446,10 +489,9 @@ func readDataDescriptor(r io.Reader, f *File) error {
|
|||
// descriptors and should account for either case when reading
|
||||
// ZIP files to ensure compatibility."
|
||||
//
|
||||
// dataDescriptorLen includes the size of the signature but
|
||||
// first read just those 4 bytes to see if it exists.
|
||||
// First read just those 4 bytes to see if the signature exists.
|
||||
if _, err := io.ReadFull(r, buf[:4]); err != nil {
|
||||
return err
|
||||
return nil, err
|
||||
}
|
||||
off := 0
|
||||
maybeSig := readBuf(buf[:4])
|
||||
|
|
@ -458,21 +500,28 @@ func readDataDescriptor(r io.Reader, f *File) error {
|
|||
// bytes.
|
||||
off += 4
|
||||
}
|
||||
if _, err := io.ReadFull(r, buf[off:12]); err != nil {
|
||||
return err
|
||||
|
||||
end := dataDescriptorLen - 4
|
||||
if zip64 {
|
||||
end = dataDescriptor64Len - 4
|
||||
}
|
||||
b := readBuf(buf[:12])
|
||||
if b.uint32() != f.CRC32 {
|
||||
return ErrChecksum
|
||||
if _, err := io.ReadFull(r, buf[off:end]); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
b := readBuf(buf[:end])
|
||||
|
||||
out := &dataDescriptor{
|
||||
crc32: b.uint32(),
|
||||
}
|
||||
|
||||
// The two sizes that follow here can be either 32 bits or 64 bits
|
||||
// but the spec is not very clear on this and different
|
||||
// interpretations has been made causing incompatibilities. We
|
||||
// already have the sizes from the central directory so we can
|
||||
// just ignore these.
|
||||
|
||||
return nil
|
||||
if zip64 {
|
||||
out.compressedSize = b.uint64()
|
||||
out.uncompressedSize = b.uint64()
|
||||
} else {
|
||||
out.compressedSize = uint64(b.uint32())
|
||||
out.uncompressedSize = uint64(b.uint32())
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func readDirectoryEnd(r io.ReaderAt, size int64) (dir *directoryEnd, err error) {
|
||||
|
|
@ -628,10 +677,11 @@ func (b *readBuf) sub(n int) readBuf {
|
|||
}
|
||||
|
||||
// A fileListEntry is a File and its ename.
|
||||
// If file == nil, the fileListEntry describes a directory, without metadata.
|
||||
// If file == nil, the fileListEntry describes a directory without metadata.
|
||||
type fileListEntry struct {
|
||||
name string
|
||||
file *File // nil for directories
|
||||
file *File
|
||||
isDir bool
|
||||
}
|
||||
|
||||
type fileInfoDirEntry interface {
|
||||
|
|
@ -640,7 +690,7 @@ type fileInfoDirEntry interface {
|
|||
}
|
||||
|
||||
func (e *fileListEntry) stat() fileInfoDirEntry {
|
||||
if e.file != nil {
|
||||
if !e.isDir {
|
||||
return headerFileInfo{&e.file.FileHeader}
|
||||
}
|
||||
return e
|
||||
|
|
@ -649,12 +699,18 @@ func (e *fileListEntry) stat() fileInfoDirEntry {
|
|||
// Only used for directories.
|
||||
func (f *fileListEntry) Name() string { _, elem, _ := split(f.name); return elem }
|
||||
func (f *fileListEntry) Size() int64 { return 0 }
|
||||
func (f *fileListEntry) ModTime() time.Time { return time.Time{} }
|
||||
func (f *fileListEntry) Mode() fs.FileMode { return fs.ModeDir | 0555 }
|
||||
func (f *fileListEntry) Type() fs.FileMode { return fs.ModeDir }
|
||||
func (f *fileListEntry) IsDir() bool { return true }
|
||||
func (f *fileListEntry) Sys() interface{} { return nil }
|
||||
|
||||
func (f *fileListEntry) ModTime() time.Time {
|
||||
if f.file == nil {
|
||||
return time.Time{}
|
||||
}
|
||||
return f.file.FileHeader.Modified.UTC()
|
||||
}
|
||||
|
||||
func (f *fileListEntry) Info() (fs.FileInfo, error) { return f, nil }
|
||||
|
||||
// toValidName coerces name to be a valid name for fs.FS.Open.
|
||||
|
|
@ -664,7 +720,7 @@ func toValidName(name string) string {
|
|||
if strings.HasPrefix(p, "/") {
|
||||
p = p[len("/"):]
|
||||
}
|
||||
for strings.HasPrefix(name, "../") {
|
||||
for strings.HasPrefix(p, "../") {
|
||||
p = p[len("../"):]
|
||||
}
|
||||
return p
|
||||
|
|
@ -673,15 +729,32 @@ func toValidName(name string) string {
|
|||
func (r *Reader) initFileList() {
|
||||
r.fileListOnce.Do(func() {
|
||||
dirs := make(map[string]bool)
|
||||
knownDirs := make(map[string]bool)
|
||||
for _, file := range r.File {
|
||||
isDir := len(file.Name) > 0 && file.Name[len(file.Name)-1] == '/'
|
||||
name := toValidName(file.Name)
|
||||
for dir := path.Dir(name); dir != "."; dir = path.Dir(dir) {
|
||||
dirs[dir] = true
|
||||
}
|
||||
r.fileList = append(r.fileList, fileListEntry{name, file})
|
||||
entry := fileListEntry{
|
||||
name: name,
|
||||
file: file,
|
||||
isDir: isDir,
|
||||
}
|
||||
r.fileList = append(r.fileList, entry)
|
||||
if isDir {
|
||||
knownDirs[name] = true
|
||||
}
|
||||
}
|
||||
for dir := range dirs {
|
||||
r.fileList = append(r.fileList, fileListEntry{dir + "/", nil})
|
||||
if !knownDirs[dir] {
|
||||
entry := fileListEntry{
|
||||
name: dir,
|
||||
file: nil,
|
||||
isDir: true,
|
||||
}
|
||||
r.fileList = append(r.fileList, entry)
|
||||
}
|
||||
}
|
||||
|
||||
sort.Slice(r.fileList, func(i, j int) bool { return fileEntryLess(r.fileList[i].name, r.fileList[j].name) })
|
||||
|
|
@ -705,7 +778,7 @@ func (r *Reader) Open(name string) (fs.File, error) {
|
|||
if e == nil || !fs.ValidPath(name) {
|
||||
return nil, &fs.PathError{Op: "open", Path: name, Err: fs.ErrNotExist}
|
||||
}
|
||||
if e.file == nil || strings.HasSuffix(e.file.Name, "/") {
|
||||
if e.isDir {
|
||||
return &openDir{e, r.openReadDir(name), 0}, nil
|
||||
}
|
||||
rc, err := e.file.Open()
|
||||
|
|
@ -730,7 +803,7 @@ func split(name string) (dir, elem string, isDir bool) {
|
|||
return name[:i], name[i+1:], isDir
|
||||
}
|
||||
|
||||
var dotFile = &fileListEntry{name: "./"}
|
||||
var dotFile = &fileListEntry{name: "./", isDir: true}
|
||||
|
||||
func (r *Reader) openLookup(name string) *fileListEntry {
|
||||
if name == "." {
|
||||
|
|
|
|||
|
|
@ -499,9 +499,15 @@ func TestReader(t *testing.T) {
|
|||
func readTestZip(t *testing.T, zt ZipTest) {
|
||||
var z *Reader
|
||||
var err error
|
||||
var raw []byte
|
||||
if zt.Source != nil {
|
||||
rat, size := zt.Source()
|
||||
z, err = NewReader(rat, size)
|
||||
raw = make([]byte, size)
|
||||
if _, err := rat.ReadAt(raw, 0); err != nil {
|
||||
t.Errorf("ReadAt error=%v", err)
|
||||
return
|
||||
}
|
||||
} else {
|
||||
path := filepath.Join("testdata", zt.Name)
|
||||
if zt.Obscured {
|
||||
|
|
@ -519,6 +525,12 @@ func readTestZip(t *testing.T, zt ZipTest) {
|
|||
defer rc.Close()
|
||||
z = &rc.Reader
|
||||
}
|
||||
var err2 error
|
||||
raw, err2 = os.ReadFile(path)
|
||||
if err2 != nil {
|
||||
t.Errorf("ReadFile(%s) error=%v", path, err2)
|
||||
return
|
||||
}
|
||||
}
|
||||
if err != zt.Error {
|
||||
t.Errorf("error=%v, want %v", err, zt.Error)
|
||||
|
|
@ -545,7 +557,7 @@ func readTestZip(t *testing.T, zt ZipTest) {
|
|||
|
||||
// test read of each file
|
||||
for i, ft := range zt.File {
|
||||
readTestFile(t, zt, ft, z.File[i])
|
||||
readTestFile(t, zt, ft, z.File[i], raw)
|
||||
}
|
||||
if t.Failed() {
|
||||
return
|
||||
|
|
@ -557,7 +569,7 @@ func readTestZip(t *testing.T, zt ZipTest) {
|
|||
for i := 0; i < 5; i++ {
|
||||
for j, ft := range zt.File {
|
||||
go func(j int, ft ZipTestFile) {
|
||||
readTestFile(t, zt, ft, z.File[j])
|
||||
readTestFile(t, zt, ft, z.File[j], raw)
|
||||
done <- true
|
||||
}(j, ft)
|
||||
n++
|
||||
|
|
@ -574,7 +586,7 @@ func equalTimeAndZone(t1, t2 time.Time) bool {
|
|||
return t1.Equal(t2) && name1 == name2 && offset1 == offset2
|
||||
}
|
||||
|
||||
func readTestFile(t *testing.T, zt ZipTest, ft ZipTestFile, f *File) {
|
||||
func readTestFile(t *testing.T, zt ZipTest, ft ZipTestFile, f *File, raw []byte) {
|
||||
if f.Name != ft.Name {
|
||||
t.Errorf("name=%q, want %q", f.Name, ft.Name)
|
||||
}
|
||||
|
|
@ -594,6 +606,31 @@ func readTestFile(t *testing.T, zt ZipTest, ft ZipTestFile, f *File) {
|
|||
t.Errorf("%v: UncompressedSize=%#x does not match UncompressedSize64=%#x", f.Name, size, f.UncompressedSize64)
|
||||
}
|
||||
|
||||
// Check that OpenRaw returns the correct byte segment
|
||||
rw, err := f.OpenRaw()
|
||||
if err != nil {
|
||||
t.Errorf("%v: OpenRaw error=%v", f.Name, err)
|
||||
return
|
||||
}
|
||||
start, err := f.DataOffset()
|
||||
if err != nil {
|
||||
t.Errorf("%v: DataOffset error=%v", f.Name, err)
|
||||
return
|
||||
}
|
||||
got, err := io.ReadAll(rw)
|
||||
if err != nil {
|
||||
t.Errorf("%v: OpenRaw ReadAll error=%v", f.Name, err)
|
||||
return
|
||||
}
|
||||
end := uint64(start) + f.CompressedSize64
|
||||
want := raw[start:end]
|
||||
if !bytes.Equal(got, want) {
|
||||
t.Logf("got %q", got)
|
||||
t.Logf("want %q", want)
|
||||
t.Errorf("%v: OpenRaw returned unexpected bytes", f.Name)
|
||||
return
|
||||
}
|
||||
|
||||
r, err := f.Open()
|
||||
if err != nil {
|
||||
t.Errorf("%v", err)
|
||||
|
|
@ -776,8 +813,8 @@ func returnRecursiveZip() (r io.ReaderAt, size int64) {
|
|||
// "archive/zip"
|
||||
// "bytes"
|
||||
// "io"
|
||||
// "io/ioutil"
|
||||
// "log"
|
||||
// "os"
|
||||
// )
|
||||
//
|
||||
// type zeros struct{}
|
||||
|
|
@ -1073,11 +1110,218 @@ func TestIssue12449(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestFS(t *testing.T) {
|
||||
z, err := OpenReader("testdata/unix.zip")
|
||||
for _, test := range []struct {
|
||||
file string
|
||||
want []string
|
||||
}{
|
||||
{
|
||||
"testdata/unix.zip",
|
||||
[]string{"hello", "dir/bar", "readonly"},
|
||||
},
|
||||
{
|
||||
"testdata/subdir.zip",
|
||||
[]string{"a/b/c"},
|
||||
},
|
||||
} {
|
||||
t.Run(test.file, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
z, err := OpenReader(test.file)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := fstest.TestFS(z, "hello", "dir/bar", "dir/empty", "readonly"); err != nil {
|
||||
defer z.Close()
|
||||
if err := fstest.TestFS(z, test.want...); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestFSModTime(t *testing.T) {
|
||||
t.Parallel()
|
||||
z, err := OpenReader("testdata/subdir.zip")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer z.Close()
|
||||
|
||||
for _, test := range []struct {
|
||||
name string
|
||||
want time.Time
|
||||
}{
|
||||
{
|
||||
"a",
|
||||
time.Date(2021, 4, 19, 12, 29, 56, 0, timeZone(-7*time.Hour)).UTC(),
|
||||
},
|
||||
{
|
||||
"a/b/c",
|
||||
time.Date(2021, 4, 19, 12, 29, 59, 0, timeZone(-7*time.Hour)).UTC(),
|
||||
},
|
||||
} {
|
||||
fi, err := fs.Stat(z, test.name)
|
||||
if err != nil {
|
||||
t.Errorf("%s: %v", test.name, err)
|
||||
continue
|
||||
}
|
||||
if got := fi.ModTime(); !got.Equal(test.want) {
|
||||
t.Errorf("%s: got modtime %v, want %v", test.name, got, test.want)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestCVE202127919(t *testing.T) {
|
||||
// Archive containing only the file "../test.txt"
|
||||
data := []byte{
|
||||
0x50, 0x4b, 0x03, 0x04, 0x14, 0x00, 0x08, 0x00,
|
||||
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x2e, 0x2e,
|
||||
0x2f, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x74, 0x78,
|
||||
0x74, 0x0a, 0xc9, 0xc8, 0x2c, 0x56, 0xc8, 0x2c,
|
||||
0x56, 0x48, 0x54, 0x28, 0x49, 0x2d, 0x2e, 0x51,
|
||||
0x28, 0x49, 0xad, 0x28, 0x51, 0x48, 0xcb, 0xcc,
|
||||
0x49, 0xd5, 0xe3, 0x02, 0x04, 0x00, 0x00, 0xff,
|
||||
0xff, 0x50, 0x4b, 0x07, 0x08, 0xc0, 0xd7, 0xed,
|
||||
0xc3, 0x20, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00,
|
||||
0x00, 0x50, 0x4b, 0x01, 0x02, 0x14, 0x00, 0x14,
|
||||
0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0xc0, 0xd7, 0xed, 0xc3, 0x20, 0x00, 0x00,
|
||||
0x00, 0x1a, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2e,
|
||||
0x2e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x74,
|
||||
0x78, 0x74, 0x50, 0x4b, 0x05, 0x06, 0x00, 0x00,
|
||||
0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x39, 0x00,
|
||||
0x00, 0x00, 0x59, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
}
|
||||
r, err := NewReader(bytes.NewReader([]byte(data)), int64(len(data)))
|
||||
if err != nil {
|
||||
t.Fatalf("Error reading the archive: %v", err)
|
||||
}
|
||||
_, err = r.Open("test.txt")
|
||||
if err != nil {
|
||||
t.Errorf("Error reading file: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestReadDataDescriptor(t *testing.T) {
|
||||
tests := []struct {
|
||||
desc string
|
||||
in []byte
|
||||
zip64 bool
|
||||
want *dataDescriptor
|
||||
wantErr error
|
||||
}{{
|
||||
desc: "valid 32 bit with signature",
|
||||
in: []byte{
|
||||
0x50, 0x4b, 0x07, 0x08, // signature
|
||||
0x00, 0x01, 0x02, 0x03, // crc32
|
||||
0x04, 0x05, 0x06, 0x07, // compressed size
|
||||
0x08, 0x09, 0x0a, 0x0b, // uncompressed size
|
||||
},
|
||||
want: &dataDescriptor{
|
||||
crc32: 0x03020100,
|
||||
compressedSize: 0x07060504,
|
||||
uncompressedSize: 0x0b0a0908,
|
||||
},
|
||||
}, {
|
||||
desc: "valid 32 bit without signature",
|
||||
in: []byte{
|
||||
0x00, 0x01, 0x02, 0x03, // crc32
|
||||
0x04, 0x05, 0x06, 0x07, // compressed size
|
||||
0x08, 0x09, 0x0a, 0x0b, // uncompressed size
|
||||
},
|
||||
want: &dataDescriptor{
|
||||
crc32: 0x03020100,
|
||||
compressedSize: 0x07060504,
|
||||
uncompressedSize: 0x0b0a0908,
|
||||
},
|
||||
}, {
|
||||
desc: "valid 64 bit with signature",
|
||||
in: []byte{
|
||||
0x50, 0x4b, 0x07, 0x08, // signature
|
||||
0x00, 0x01, 0x02, 0x03, // crc32
|
||||
0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, // compressed size
|
||||
0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, // uncompressed size
|
||||
},
|
||||
zip64: true,
|
||||
want: &dataDescriptor{
|
||||
crc32: 0x03020100,
|
||||
compressedSize: 0x0b0a090807060504,
|
||||
uncompressedSize: 0x131211100f0e0d0c,
|
||||
},
|
||||
}, {
|
||||
desc: "valid 64 bit without signature",
|
||||
in: []byte{
|
||||
0x00, 0x01, 0x02, 0x03, // crc32
|
||||
0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, // compressed size
|
||||
0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, // uncompressed size
|
||||
},
|
||||
zip64: true,
|
||||
want: &dataDescriptor{
|
||||
crc32: 0x03020100,
|
||||
compressedSize: 0x0b0a090807060504,
|
||||
uncompressedSize: 0x131211100f0e0d0c,
|
||||
},
|
||||
}, {
|
||||
desc: "invalid 32 bit with signature",
|
||||
in: []byte{
|
||||
0x50, 0x4b, 0x07, 0x08, // signature
|
||||
0x00, 0x01, 0x02, 0x03, // crc32
|
||||
0x04, 0x05, // unexpected end
|
||||
},
|
||||
wantErr: io.ErrUnexpectedEOF,
|
||||
}, {
|
||||
desc: "invalid 32 bit without signature",
|
||||
in: []byte{
|
||||
0x00, 0x01, 0x02, 0x03, // crc32
|
||||
0x04, 0x05, // unexpected end
|
||||
},
|
||||
wantErr: io.ErrUnexpectedEOF,
|
||||
}, {
|
||||
desc: "invalid 64 bit with signature",
|
||||
in: []byte{
|
||||
0x50, 0x4b, 0x07, 0x08, // signature
|
||||
0x00, 0x01, 0x02, 0x03, // crc32
|
||||
0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, // compressed size
|
||||
0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, // unexpected end
|
||||
},
|
||||
zip64: true,
|
||||
wantErr: io.ErrUnexpectedEOF,
|
||||
}, {
|
||||
desc: "invalid 64 bit without signature",
|
||||
in: []byte{
|
||||
0x00, 0x01, 0x02, 0x03, // crc32
|
||||
0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, // compressed size
|
||||
0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, // unexpected end
|
||||
},
|
||||
zip64: true,
|
||||
wantErr: io.ErrUnexpectedEOF,
|
||||
}}
|
||||
|
||||
for _, test := range tests {
|
||||
t.Run(test.desc, func(t *testing.T) {
|
||||
r := bytes.NewReader(test.in)
|
||||
|
||||
desc, err := readDataDescriptor(r, test.zip64)
|
||||
if err != test.wantErr {
|
||||
t.Fatalf("got err %v; want nil", err)
|
||||
}
|
||||
if test.want == nil {
|
||||
return
|
||||
}
|
||||
if desc == nil {
|
||||
t.Fatalf("got nil DataDescriptor; want non-nil")
|
||||
}
|
||||
if desc.crc32 != test.want.crc32 {
|
||||
t.Errorf("got CRC32 %#x; want %#x", desc.crc32, test.want.crc32)
|
||||
}
|
||||
if desc.compressedSize != test.want.compressedSize {
|
||||
t.Errorf("got CompressedSize %#x; want %#x", desc.compressedSize, test.want.compressedSize)
|
||||
}
|
||||
if desc.uncompressedSize != test.want.uncompressedSize {
|
||||
t.Errorf("got UncompressedSize %#x; want %#x", desc.uncompressedSize, test.want.uncompressedSize)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ const (
|
|||
directoryHeaderLen = 46 // + filename + extra + comment
|
||||
directoryEndLen = 22 // + comment
|
||||
dataDescriptorLen = 16 // four uint32: descriptor signature, crc32, compressed size, size
|
||||
dataDescriptor64Len = 24 // descriptor with 8 byte sizes
|
||||
dataDescriptor64Len = 24 // two uint32: signature, crc32 | two uint64: compressed size, size
|
||||
directory64LocLen = 20 //
|
||||
directory64EndLen = 56 // + extra
|
||||
|
||||
|
|
@ -315,6 +315,10 @@ func (h *FileHeader) isZip64() bool {
|
|||
return h.CompressedSize64 >= uint32max || h.UncompressedSize64 >= uint32max
|
||||
}
|
||||
|
||||
func (f *FileHeader) hasDataDescriptor() bool {
|
||||
return f.Flags&0x8 != 0
|
||||
}
|
||||
|
||||
func msdosModeToFileMode(m uint32) (mode fs.FileMode) {
|
||||
if m&msdosDir != 0 {
|
||||
mode = fs.ModeDir | 0777
|
||||
|
|
@ -341,11 +345,9 @@ func fileModeToUnixMode(mode fs.FileMode) uint32 {
|
|||
case fs.ModeSocket:
|
||||
m = s_IFSOCK
|
||||
case fs.ModeDevice:
|
||||
if mode&fs.ModeCharDevice != 0 {
|
||||
m = s_IFCHR
|
||||
} else {
|
||||
m = s_IFBLK
|
||||
}
|
||||
case fs.ModeDevice | fs.ModeCharDevice:
|
||||
m = s_IFCHR
|
||||
}
|
||||
if mode&fs.ModeSetuid != 0 {
|
||||
m |= s_ISUID
|
||||
|
|
@ -388,3 +390,11 @@ func unixModeToFileMode(m uint32) fs.FileMode {
|
|||
}
|
||||
return mode
|
||||
}
|
||||
|
||||
// dataDescriptor holds the data descriptor that optionally follows the file
|
||||
// contents in the zip file.
|
||||
type dataDescriptor struct {
|
||||
crc32 uint32
|
||||
compressedSize uint64
|
||||
uncompressedSize uint64
|
||||
}
|
||||
|
|
|
|||
BIN
src/archive/zip/testdata/subdir.zip
vendored
Normal file
BIN
src/archive/zip/testdata/subdir.zip
vendored
Normal file
Binary file not shown.
|
|
@ -37,6 +37,7 @@ type Writer struct {
|
|||
type header struct {
|
||||
*FileHeader
|
||||
offset uint64
|
||||
raw bool
|
||||
}
|
||||
|
||||
// NewWriter returns a new Writer writing a zip file to w.
|
||||
|
|
@ -245,23 +246,32 @@ func detectUTF8(s string) (valid, require bool) {
|
|||
return true, require
|
||||
}
|
||||
|
||||
// prepare performs the bookkeeping operations required at the start of
|
||||
// CreateHeader and CreateRaw.
|
||||
func (w *Writer) prepare(fh *FileHeader) error {
|
||||
if w.last != nil && !w.last.closed {
|
||||
if err := w.last.close(); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if len(w.dir) > 0 && w.dir[len(w.dir)-1].FileHeader == fh {
|
||||
// See https://golang.org/issue/11144 confusion.
|
||||
return errors.New("archive/zip: invalid duplicate FileHeader")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// CreateHeader adds a file to the zip archive using the provided FileHeader
|
||||
// for the file metadata. Writer takes ownership of fh and may mutate
|
||||
// its fields. The caller must not modify fh after calling CreateHeader.
|
||||
//
|
||||
// This returns a Writer to which the file contents should be written.
|
||||
// The file's contents must be written to the io.Writer before the next
|
||||
// call to Create, CreateHeader, or Close.
|
||||
// call to Create, CreateHeader, CreateRaw, or Close.
|
||||
func (w *Writer) CreateHeader(fh *FileHeader) (io.Writer, error) {
|
||||
if w.last != nil && !w.last.closed {
|
||||
if err := w.last.close(); err != nil {
|
||||
if err := w.prepare(fh); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
if len(w.dir) > 0 && w.dir[len(w.dir)-1].FileHeader == fh {
|
||||
// See https://golang.org/issue/11144 confusion.
|
||||
return nil, errors.New("archive/zip: invalid duplicate FileHeader")
|
||||
}
|
||||
|
||||
// The ZIP format has a sad state of affairs regarding character encoding.
|
||||
// Officially, the name and comment fields are supposed to be encoded
|
||||
|
|
@ -365,7 +375,7 @@ func (w *Writer) CreateHeader(fh *FileHeader) (io.Writer, error) {
|
|||
ow = fw
|
||||
}
|
||||
w.dir = append(w.dir, h)
|
||||
if err := writeHeader(w.cw, fh); err != nil {
|
||||
if err := writeHeader(w.cw, h); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// If we're creating a directory, fw is nil.
|
||||
|
|
@ -373,7 +383,7 @@ func (w *Writer) CreateHeader(fh *FileHeader) (io.Writer, error) {
|
|||
return ow, nil
|
||||
}
|
||||
|
||||
func writeHeader(w io.Writer, h *FileHeader) error {
|
||||
func writeHeader(w io.Writer, h *header) error {
|
||||
const maxUint16 = 1<<16 - 1
|
||||
if len(h.Name) > maxUint16 {
|
||||
return errLongName
|
||||
|
|
@ -390,9 +400,20 @@ func writeHeader(w io.Writer, h *FileHeader) error {
|
|||
b.uint16(h.Method)
|
||||
b.uint16(h.ModifiedTime)
|
||||
b.uint16(h.ModifiedDate)
|
||||
b.uint32(0) // since we are writing a data descriptor crc32,
|
||||
b.uint32(0) // compressed size,
|
||||
b.uint32(0) // and uncompressed size should be zero
|
||||
// In raw mode (caller does the compression), the values are either
|
||||
// written here or in the trailing data descriptor based on the header
|
||||
// flags.
|
||||
if h.raw && !h.hasDataDescriptor() {
|
||||
b.uint32(h.CRC32)
|
||||
b.uint32(uint32(min64(h.CompressedSize64, uint32max)))
|
||||
b.uint32(uint32(min64(h.UncompressedSize64, uint32max)))
|
||||
} else {
|
||||
// When this package handle the compression, these values are
|
||||
// always written to the trailing data descriptor.
|
||||
b.uint32(0) // crc32
|
||||
b.uint32(0) // compressed size
|
||||
b.uint32(0) // uncompressed size
|
||||
}
|
||||
b.uint16(uint16(len(h.Name)))
|
||||
b.uint16(uint16(len(h.Extra)))
|
||||
if _, err := w.Write(buf[:]); err != nil {
|
||||
|
|
@ -405,6 +426,65 @@ func writeHeader(w io.Writer, h *FileHeader) error {
|
|||
return err
|
||||
}
|
||||
|
||||
func min64(x, y uint64) uint64 {
|
||||
if x < y {
|
||||
return x
|
||||
}
|
||||
return y
|
||||
}
|
||||
|
||||
// CreateRaw adds a file to the zip archive using the provided FileHeader and
|
||||
// returns a Writer to which the file contents should be written. The file's
|
||||
// contents must be written to the io.Writer before the next call to Create,
|
||||
// CreateHeader, CreateRaw, or Close.
|
||||
//
|
||||
// In contrast to CreateHeader, the bytes passed to Writer are not compressed.
|
||||
func (w *Writer) CreateRaw(fh *FileHeader) (io.Writer, error) {
|
||||
if err := w.prepare(fh); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
fh.CompressedSize = uint32(min64(fh.CompressedSize64, uint32max))
|
||||
fh.UncompressedSize = uint32(min64(fh.UncompressedSize64, uint32max))
|
||||
|
||||
h := &header{
|
||||
FileHeader: fh,
|
||||
offset: uint64(w.cw.count),
|
||||
raw: true,
|
||||
}
|
||||
w.dir = append(w.dir, h)
|
||||
if err := writeHeader(w.cw, h); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if strings.HasSuffix(fh.Name, "/") {
|
||||
w.last = nil
|
||||
return dirWriter{}, nil
|
||||
}
|
||||
|
||||
fw := &fileWriter{
|
||||
header: h,
|
||||
zipw: w.cw,
|
||||
}
|
||||
w.last = fw
|
||||
return fw, nil
|
||||
}
|
||||
|
||||
// Copy copies the file f (obtained from a Reader) into w. It copies the raw
|
||||
// form directly bypassing decompression, compression, and validation.
|
||||
func (w *Writer) Copy(f *File) error {
|
||||
r, err := f.OpenRaw()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fw, err := w.CreateRaw(&f.FileHeader)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
_, err = io.Copy(fw, r)
|
||||
return err
|
||||
}
|
||||
|
||||
// RegisterCompressor registers or overrides a custom compressor for a specific
|
||||
// method ID. If a compressor for a given method is not found, Writer will
|
||||
// default to looking up the compressor at the package level.
|
||||
|
|
@ -446,6 +526,9 @@ func (w *fileWriter) Write(p []byte) (int, error) {
|
|||
if w.closed {
|
||||
return 0, errors.New("zip: write to closed file")
|
||||
}
|
||||
if w.raw {
|
||||
return w.zipw.Write(p)
|
||||
}
|
||||
w.crc32.Write(p)
|
||||
return w.rawCount.Write(p)
|
||||
}
|
||||
|
|
@ -455,6 +538,9 @@ func (w *fileWriter) close() error {
|
|||
return errors.New("zip: file closed twice")
|
||||
}
|
||||
w.closed = true
|
||||
if w.raw {
|
||||
return w.writeDataDescriptor()
|
||||
}
|
||||
if err := w.comp.Close(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
@ -474,26 +560,33 @@ func (w *fileWriter) close() error {
|
|||
fh.UncompressedSize = uint32(fh.UncompressedSize64)
|
||||
}
|
||||
|
||||
return w.writeDataDescriptor()
|
||||
}
|
||||
|
||||
func (w *fileWriter) writeDataDescriptor() error {
|
||||
if !w.hasDataDescriptor() {
|
||||
return nil
|
||||
}
|
||||
// Write data descriptor. This is more complicated than one would
|
||||
// think, see e.g. comments in zipfile.c:putextended() and
|
||||
// http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7073588.
|
||||
// The approach here is to write 8 byte sizes if needed without
|
||||
// adding a zip64 extra in the local header (too late anyway).
|
||||
var buf []byte
|
||||
if fh.isZip64() {
|
||||
if w.isZip64() {
|
||||
buf = make([]byte, dataDescriptor64Len)
|
||||
} else {
|
||||
buf = make([]byte, dataDescriptorLen)
|
||||
}
|
||||
b := writeBuf(buf)
|
||||
b.uint32(dataDescriptorSignature) // de-facto standard, required by OS X
|
||||
b.uint32(fh.CRC32)
|
||||
if fh.isZip64() {
|
||||
b.uint64(fh.CompressedSize64)
|
||||
b.uint64(fh.UncompressedSize64)
|
||||
b.uint32(w.CRC32)
|
||||
if w.isZip64() {
|
||||
b.uint64(w.CompressedSize64)
|
||||
b.uint64(w.UncompressedSize64)
|
||||
} else {
|
||||
b.uint32(fh.CompressedSize)
|
||||
b.uint32(fh.UncompressedSize)
|
||||
b.uint32(w.CompressedSize)
|
||||
b.uint32(w.UncompressedSize)
|
||||
}
|
||||
_, err := w.zipw.Write(buf)
|
||||
return err
|
||||
|
|
|
|||
|
|
@ -6,8 +6,10 @@ package zip
|
|||
|
||||
import (
|
||||
"bytes"
|
||||
"compress/flate"
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
"hash/crc32"
|
||||
"io"
|
||||
"io/fs"
|
||||
"math/rand"
|
||||
|
|
@ -57,6 +59,18 @@ var writeTests = []WriteTest{
|
|||
Method: Deflate,
|
||||
Mode: 0755 | fs.ModeSymlink,
|
||||
},
|
||||
{
|
||||
Name: "device",
|
||||
Data: []byte("device file"),
|
||||
Method: Deflate,
|
||||
Mode: 0755 | fs.ModeDevice,
|
||||
},
|
||||
{
|
||||
Name: "chardevice",
|
||||
Data: []byte("char device file"),
|
||||
Method: Deflate,
|
||||
Mode: 0755 | fs.ModeDevice | fs.ModeCharDevice,
|
||||
},
|
||||
}
|
||||
|
||||
func TestWriter(t *testing.T) {
|
||||
|
|
@ -353,6 +367,171 @@ func TestWriterDirAttributes(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestWriterCopy(t *testing.T) {
|
||||
// make a zip file
|
||||
buf := new(bytes.Buffer)
|
||||
w := NewWriter(buf)
|
||||
for _, wt := range writeTests {
|
||||
testCreate(t, w, &wt)
|
||||
}
|
||||
if err := w.Close(); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
// read it back
|
||||
src, err := NewReader(bytes.NewReader(buf.Bytes()), int64(buf.Len()))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
for i, wt := range writeTests {
|
||||
testReadFile(t, src.File[i], &wt)
|
||||
}
|
||||
|
||||
// make a new zip file copying the old compressed data.
|
||||
buf2 := new(bytes.Buffer)
|
||||
dst := NewWriter(buf2)
|
||||
for _, f := range src.File {
|
||||
if err := dst.Copy(f); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
if err := dst.Close(); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
// read the new one back
|
||||
r, err := NewReader(bytes.NewReader(buf2.Bytes()), int64(buf2.Len()))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
for i, wt := range writeTests {
|
||||
testReadFile(t, r.File[i], &wt)
|
||||
}
|
||||
}
|
||||
|
||||
func TestWriterCreateRaw(t *testing.T) {
|
||||
files := []struct {
|
||||
name string
|
||||
content []byte
|
||||
method uint16
|
||||
flags uint16
|
||||
crc32 uint32
|
||||
uncompressedSize uint64
|
||||
compressedSize uint64
|
||||
}{
|
||||
{
|
||||
name: "small store w desc",
|
||||
content: []byte("gophers"),
|
||||
method: Store,
|
||||
flags: 0x8,
|
||||
},
|
||||
{
|
||||
name: "small deflate wo desc",
|
||||
content: bytes.Repeat([]byte("abcdefg"), 2048),
|
||||
method: Deflate,
|
||||
},
|
||||
}
|
||||
|
||||
// write a zip file
|
||||
archive := new(bytes.Buffer)
|
||||
w := NewWriter(archive)
|
||||
|
||||
for i := range files {
|
||||
f := &files[i]
|
||||
f.crc32 = crc32.ChecksumIEEE(f.content)
|
||||
size := uint64(len(f.content))
|
||||
f.uncompressedSize = size
|
||||
f.compressedSize = size
|
||||
|
||||
var compressedContent []byte
|
||||
if f.method == Deflate {
|
||||
var buf bytes.Buffer
|
||||
w, err := flate.NewWriter(&buf, flate.BestSpeed)
|
||||
if err != nil {
|
||||
t.Fatalf("flate.NewWriter err = %v", err)
|
||||
}
|
||||
_, err = w.Write(f.content)
|
||||
if err != nil {
|
||||
t.Fatalf("flate Write err = %v", err)
|
||||
}
|
||||
err = w.Close()
|
||||
if err != nil {
|
||||
t.Fatalf("flate Writer.Close err = %v", err)
|
||||
}
|
||||
compressedContent = buf.Bytes()
|
||||
f.compressedSize = uint64(len(compressedContent))
|
||||
}
|
||||
|
||||
h := &FileHeader{
|
||||
Name: f.name,
|
||||
Method: f.method,
|
||||
Flags: f.flags,
|
||||
CRC32: f.crc32,
|
||||
CompressedSize64: f.compressedSize,
|
||||
UncompressedSize64: f.uncompressedSize,
|
||||
}
|
||||
w, err := w.CreateRaw(h)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if compressedContent != nil {
|
||||
_, err = w.Write(compressedContent)
|
||||
} else {
|
||||
_, err = w.Write(f.content)
|
||||
}
|
||||
if err != nil {
|
||||
t.Fatalf("%s Write got %v; want nil", f.name, err)
|
||||
}
|
||||
}
|
||||
|
||||
if err := w.Close(); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
// read it back
|
||||
r, err := NewReader(bytes.NewReader(archive.Bytes()), int64(archive.Len()))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
for i, want := range files {
|
||||
got := r.File[i]
|
||||
if got.Name != want.name {
|
||||
t.Errorf("got Name %s; want %s", got.Name, want.name)
|
||||
}
|
||||
if got.Method != want.method {
|
||||
t.Errorf("%s: got Method %#x; want %#x", want.name, got.Method, want.method)
|
||||
}
|
||||
if got.Flags != want.flags {
|
||||
t.Errorf("%s: got Flags %#x; want %#x", want.name, got.Flags, want.flags)
|
||||
}
|
||||
if got.CRC32 != want.crc32 {
|
||||
t.Errorf("%s: got CRC32 %#x; want %#x", want.name, got.CRC32, want.crc32)
|
||||
}
|
||||
if got.CompressedSize64 != want.compressedSize {
|
||||
t.Errorf("%s: got CompressedSize64 %d; want %d", want.name, got.CompressedSize64, want.compressedSize)
|
||||
}
|
||||
if got.UncompressedSize64 != want.uncompressedSize {
|
||||
t.Errorf("%s: got UncompressedSize64 %d; want %d", want.name, got.UncompressedSize64, want.uncompressedSize)
|
||||
}
|
||||
|
||||
r, err := got.Open()
|
||||
if err != nil {
|
||||
t.Errorf("%s: Open err = %v", got.Name, err)
|
||||
continue
|
||||
}
|
||||
|
||||
buf, err := io.ReadAll(r)
|
||||
if err != nil {
|
||||
t.Errorf("%s: ReadAll err = %v", got.Name, err)
|
||||
continue
|
||||
}
|
||||
|
||||
if !bytes.Equal(buf, want.content) {
|
||||
t.Errorf("%v: ReadAll returned unexpected bytes", got.Name)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func testCreate(t *testing.T, w *Writer, wt *WriteTest) {
|
||||
header := &FileHeader{
|
||||
Name: wt.Name,
|
||||
|
|
@ -378,15 +557,15 @@ func testReadFile(t *testing.T, f *File, wt *WriteTest) {
|
|||
testFileMode(t, f, wt.Mode)
|
||||
rc, err := f.Open()
|
||||
if err != nil {
|
||||
t.Fatal("opening:", err)
|
||||
t.Fatalf("opening %s: %v", f.Name, err)
|
||||
}
|
||||
b, err := io.ReadAll(rc)
|
||||
if err != nil {
|
||||
t.Fatal("reading:", err)
|
||||
t.Fatalf("reading %s: %v", f.Name, err)
|
||||
}
|
||||
err = rc.Close()
|
||||
if err != nil {
|
||||
t.Fatal("closing:", err)
|
||||
t.Fatalf("closing %s: %v", f.Name, err)
|
||||
}
|
||||
if !bytes.Equal(b, wt.Data) {
|
||||
t.Errorf("File contents %q, want %q", b, wt.Data)
|
||||
|
|
|
|||
|
|
@ -670,7 +670,8 @@ func (b *Writer) WriteByte(c byte) error {
|
|||
// WriteRune writes a single Unicode code point, returning
|
||||
// the number of bytes written and any error.
|
||||
func (b *Writer) WriteRune(r rune) (size int, err error) {
|
||||
if r < utf8.RuneSelf {
|
||||
// Compare as uint32 to correctly handle negative runes.
|
||||
if uint32(r) < utf8.RuneSelf {
|
||||
err = b.WriteByte(byte(r))
|
||||
if err != nil {
|
||||
return 0, err
|
||||
|
|
|
|||
|
|
@ -534,6 +534,20 @@ func TestReadWriteRune(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestWriteInvalidRune(t *testing.T) {
|
||||
// Invalid runes, including negative ones, should be written as the
|
||||
// replacement character.
|
||||
for _, r := range []rune{-1, utf8.MaxRune + 1} {
|
||||
var buf bytes.Buffer
|
||||
w := NewWriter(&buf)
|
||||
w.WriteRune(r)
|
||||
w.Flush()
|
||||
if s := buf.String(); s != "\uFFFD" {
|
||||
t.Errorf("WriteRune(%d) wrote %q, not replacement character", r, s)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestReadStringAllocs(t *testing.T) {
|
||||
r := strings.NewReader(" foo foo 42 42 42 42 42 42 42 42 4.2 4.2 4.2 4.2\n")
|
||||
buf := NewReader(r)
|
||||
|
|
|
|||
|
|
@ -48,7 +48,8 @@ type Scanner struct {
|
|||
// and the next token to return to the user, if any, plus an error, if any.
|
||||
//
|
||||
// Scanning stops if the function returns an error, in which case some of
|
||||
// the input may be discarded.
|
||||
// the input may be discarded. If that error is ErrFinalToken, scanning
|
||||
// stops with no error.
|
||||
//
|
||||
// Otherwise, the Scanner advances the input. If the token is not nil,
|
||||
// the Scanner returns it to the user. If the token is nil, the
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
//
|
||||
//go:build linux
|
||||
// +build linux
|
||||
|
||||
package bytes_test
|
||||
|
|
|
|||
|
|
@ -275,7 +275,8 @@ func (b *Buffer) WriteByte(c byte) error {
|
|||
// included to match bufio.Writer's WriteRune. The buffer is grown as needed;
|
||||
// if it becomes too large, WriteRune will panic with ErrTooLarge.
|
||||
func (b *Buffer) WriteRune(r rune) (n int, err error) {
|
||||
if r < utf8.RuneSelf {
|
||||
// Compare as uint32 to correctly handle negative runes.
|
||||
if uint32(r) < utf8.RuneSelf {
|
||||
b.WriteByte(byte(r))
|
||||
return 1, nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ package bytes_test
|
|||
|
||||
import (
|
||||
. "bytes"
|
||||
"fmt"
|
||||
"io"
|
||||
"math/rand"
|
||||
"testing"
|
||||
|
|
@ -387,6 +388,16 @@ func TestRuneIO(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestWriteInvalidRune(t *testing.T) {
|
||||
// Invalid runes, including negative ones, should be written as
|
||||
// utf8.RuneError.
|
||||
for _, r := range []rune{-1, utf8.MaxRune + 1} {
|
||||
var buf Buffer
|
||||
buf.WriteRune(r)
|
||||
check(t, fmt.Sprintf("TestWriteInvalidRune (%d)", r), &buf, "\uFFFD")
|
||||
}
|
||||
}
|
||||
|
||||
func TestNext(t *testing.T) {
|
||||
b := []byte{0, 1, 2, 3, 4}
|
||||
tmp := make([]byte, 5)
|
||||
|
|
|
|||
|
|
@ -215,8 +215,7 @@ func main() {
|
|||
}
|
||||
optional := fileFeatures(*nextFile)
|
||||
exception := fileFeatures(*exceptFile)
|
||||
fail = !compareAPI(bw, features, required, optional, exception,
|
||||
*allowNew && strings.Contains(runtime.Version(), "devel"))
|
||||
fail = !compareAPI(bw, features, required, optional, exception, *allowNew)
|
||||
}
|
||||
|
||||
// export emits the exported package features.
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build ignore
|
||||
// +build ignore
|
||||
|
||||
// The run program is invoked via the dist tool.
|
||||
|
|
@ -9,8 +10,11 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
exec "internal/execabs"
|
||||
"internal/goversion"
|
||||
"io/fs"
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
|
@ -42,6 +46,7 @@ func main() {
|
|||
apiDir := filepath.Join(goroot, "api")
|
||||
out, err := exec.Command(goCmd(), "tool", "api",
|
||||
"-c", findAPIDirFiles(apiDir),
|
||||
allowNew(apiDir),
|
||||
"-next", filepath.Join(apiDir, "next.txt"),
|
||||
"-except", filepath.Join(apiDir, "except.txt")).CombinedOutput()
|
||||
if err != nil {
|
||||
|
|
@ -70,3 +75,35 @@ func findAPIDirFiles(apiDir string) string {
|
|||
}
|
||||
return strings.Join(apiFiles, ",")
|
||||
}
|
||||
|
||||
// allowNew returns the -allow_new flag to use for the 'go tool api' invocation.
|
||||
func allowNew(apiDir string) string {
|
||||
// Verify that the api/go1.n.txt for previous Go version exists.
|
||||
// It definitely should, otherwise it's a signal that the logic below may be outdated.
|
||||
if _, err := os.Stat(filepath.Join(apiDir, fmt.Sprintf("go1.%d.txt", goversion.Version-1))); err != nil {
|
||||
log.Fatalln("Problem with api file for previous release:", err)
|
||||
}
|
||||
|
||||
// See whether the api/go1.n.txt for this Go version has been created.
|
||||
// (As of April 2021, it gets created during the release of the first Beta.)
|
||||
_, err := os.Stat(filepath.Join(apiDir, fmt.Sprintf("go1.%d.txt", goversion.Version)))
|
||||
if errors.Is(err, fs.ErrNotExist) {
|
||||
// It doesn't exist, so we're in development or before Beta 1.
|
||||
// At this stage, unmentioned API additions are deemed okay.
|
||||
// (They will be quietly shown in API check output, but the test won't fail).
|
||||
return "-allow_new=true"
|
||||
} else if err == nil {
|
||||
// The api/go1.n.txt for this Go version has been created,
|
||||
// so we're definitely past Beta 1 in the release cycle.
|
||||
//
|
||||
// From this point, enforce that api/go1.n.txt is an accurate and complete
|
||||
// representation of what's going into the release by failing API check if
|
||||
// there are API additions (a month into the freeze, there shouldn't be many).
|
||||
//
|
||||
// See golang.org/issue/43956.
|
||||
return "-allow_new=false"
|
||||
} else {
|
||||
log.Fatal(err)
|
||||
}
|
||||
panic("unreachable")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -147,7 +147,16 @@ func arm64RegisterNumber(name string, n int16) (int16, bool) {
|
|||
return 0, false
|
||||
}
|
||||
|
||||
// ARM64RegisterExtension parses an ARM64 register with extension or arrangement.
|
||||
// ARM64RegisterShift constructs an ARM64 register with shift operation.
|
||||
func ARM64RegisterShift(reg, op, count int16) (int64, error) {
|
||||
// the base register of shift operations must be general register.
|
||||
if reg > arm64.REG_R31 || reg < arm64.REG_R0 {
|
||||
return 0, errors.New("invalid register for shift operation")
|
||||
}
|
||||
return int64(reg&31)<<16 | int64(op)<<22 | int64(uint16(count)), nil
|
||||
}
|
||||
|
||||
// ARM64RegisterExtension constructs an ARM64 register with extension or arrangement.
|
||||
func ARM64RegisterExtension(a *obj.Addr, ext string, reg, num int16, isAmount, isIndex bool) error {
|
||||
Rnum := (reg & 31) + int16(num<<5)
|
||||
if isAmount {
|
||||
|
|
@ -155,6 +164,7 @@ func ARM64RegisterExtension(a *obj.Addr, ext string, reg, num int16, isAmount, i
|
|||
return errors.New("index shift amount is out of range")
|
||||
}
|
||||
}
|
||||
if reg <= arm64.REG_R31 && reg >= arm64.REG_R0 {
|
||||
switch ext {
|
||||
case "UXTB":
|
||||
if !isAmount {
|
||||
|
|
@ -226,6 +236,12 @@ func ARM64RegisterExtension(a *obj.Addr, ext string, reg, num int16, isAmount, i
|
|||
return errors.New("invalid register extension")
|
||||
}
|
||||
a.Index = arm64.REG_LSL + Rnum
|
||||
default:
|
||||
return errors.New("unsupported general register extension type: " + ext)
|
||||
|
||||
}
|
||||
} else if reg <= arm64.REG_V31 && reg >= arm64.REG_V0 {
|
||||
switch ext {
|
||||
case "B8":
|
||||
if isIndex {
|
||||
return errors.New("invalid register extension")
|
||||
|
|
@ -296,13 +312,15 @@ func ARM64RegisterExtension(a *obj.Addr, ext string, reg, num int16, isAmount, i
|
|||
a.Reg = arm64.REG_ELEM + (reg & 31) + ((arm64.ARNG_D & 15) << 5)
|
||||
a.Index = num
|
||||
default:
|
||||
return errors.New("unsupported register extension type: " + ext)
|
||||
return errors.New("unsupported simd register extension type: " + ext)
|
||||
}
|
||||
} else {
|
||||
return errors.New("invalid register and extension combination")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ARM64RegisterArrangement parses an ARM64 vector register arrangement.
|
||||
// ARM64RegisterArrangement constructs an ARM64 vector register arrangement.
|
||||
func ARM64RegisterArrangement(reg int16, name, arng string) (int64, error) {
|
||||
var curQ, curSize uint16
|
||||
if name[0] != 'V' {
|
||||
|
|
|
|||
|
|
@ -134,6 +134,14 @@ func (p *Parser) asmText(operands [][]lex.Token) {
|
|||
next++
|
||||
}
|
||||
|
||||
// Issue an error if we see a function defined as ABIInternal
|
||||
// without NOSPLIT. In ABIInternal, obj needs to know the function
|
||||
// signature in order to construct the morestack path, so this
|
||||
// currently isn't supported for asm functions.
|
||||
if nameAddr.Sym.ABI() == obj.ABIInternal && flag&obj.NOSPLIT == 0 {
|
||||
p.errorf("TEXT %q: ABIInternal requires NOSPLIT", name)
|
||||
}
|
||||
|
||||
// Next operand is the frame and arg size.
|
||||
// Bizarre syntax: $frameSize-argSize is two words, not subtraction.
|
||||
// Both frameSize and argSize must be simple integers; only frameSize
|
||||
|
|
@ -799,22 +807,11 @@ func (p *Parser) asmInstruction(op obj.As, cond string, a []obj.Addr) {
|
|||
p.errorf("can't handle %s instruction with 4 operands", op)
|
||||
return
|
||||
case 5:
|
||||
if p.arch.Family == sys.PPC64 && arch.IsPPC64RLD(op) {
|
||||
// Always reg, reg, con, con, reg. (con, con is a 'mask').
|
||||
if p.arch.Family == sys.PPC64 {
|
||||
prog.From = a[0]
|
||||
// Second arg is always a register type on ppc64.
|
||||
prog.Reg = p.getRegister(prog, op, &a[1])
|
||||
mask1 := p.getConstant(prog, op, &a[2])
|
||||
mask2 := p.getConstant(prog, op, &a[3])
|
||||
var mask uint32
|
||||
if mask1 < mask2 {
|
||||
mask = (^uint32(0) >> uint(mask1)) & (^uint32(0) << uint(31-mask2))
|
||||
} else {
|
||||
mask = (^uint32(0) >> uint(mask2+1)) & (^uint32(0) << uint(31-(mask1-1)))
|
||||
}
|
||||
prog.SetFrom3(obj.Addr{
|
||||
Type: obj.TYPE_CONST,
|
||||
Offset: int64(mask),
|
||||
})
|
||||
prog.SetRestArgs([]obj.Addr{a[2], a[3]})
|
||||
prog.To = a[4]
|
||||
break
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import (
|
|||
"bufio"
|
||||
"bytes"
|
||||
"fmt"
|
||||
"internal/buildcfg"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
|
@ -19,7 +20,6 @@ import (
|
|||
|
||||
"cmd/asm/internal/lex"
|
||||
"cmd/internal/obj"
|
||||
"cmd/internal/objabi"
|
||||
)
|
||||
|
||||
// An end-to-end test for the assembler: Do we print what we parse?
|
||||
|
|
@ -270,7 +270,7 @@ var (
|
|||
errQuotesRE = regexp.MustCompile(`"([^"]*)"`)
|
||||
)
|
||||
|
||||
func testErrors(t *testing.T, goarch, file string) {
|
||||
func testErrors(t *testing.T, goarch, file string, flags ...string) {
|
||||
input := filepath.Join("testdata", file+".s")
|
||||
architecture, ctxt := setArch(goarch)
|
||||
lexer := lex.NewLexer(input)
|
||||
|
|
@ -292,6 +292,14 @@ func testErrors(t *testing.T, goarch, file string) {
|
|||
}
|
||||
errBuf.WriteString(s)
|
||||
}
|
||||
for _, flag := range flags {
|
||||
switch flag {
|
||||
case "dynlink":
|
||||
ctxt.Flag_dynlink = true
|
||||
default:
|
||||
t.Errorf("unknown flag %s", flag)
|
||||
}
|
||||
}
|
||||
pList.Firstpc, ok = parser.Parse()
|
||||
obj.Flushplist(ctxt, pList, nil, "")
|
||||
if ok && !failed {
|
||||
|
|
@ -360,10 +368,10 @@ func Test386EndToEnd(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestARMEndToEnd(t *testing.T) {
|
||||
defer func(old int) { objabi.GOARM = old }(objabi.GOARM)
|
||||
defer func(old int) { buildcfg.GOARM = old }(buildcfg.GOARM)
|
||||
for _, goarm := range []int{5, 6, 7} {
|
||||
t.Logf("GOARM=%d", goarm)
|
||||
objabi.GOARM = goarm
|
||||
buildcfg.GOARM = goarm
|
||||
testEndToEnd(t, "arm", "arm")
|
||||
if goarm == 6 {
|
||||
testEndToEnd(t, "arm", "armv6")
|
||||
|
|
@ -430,6 +438,10 @@ func TestAMD64Errors(t *testing.T) {
|
|||
testErrors(t, "amd64", "amd64error")
|
||||
}
|
||||
|
||||
func TestAMD64DynLinkErrors(t *testing.T) {
|
||||
testErrors(t, "amd64", "amd64dynlinkerror", "dynlink")
|
||||
}
|
||||
|
||||
func TestMIPSEndToEnd(t *testing.T) {
|
||||
testEndToEnd(t, "mips", "mips")
|
||||
testEndToEnd(t, "mips64", "mips64")
|
||||
|
|
@ -439,8 +451,12 @@ func TestPPC64EndToEnd(t *testing.T) {
|
|||
testEndToEnd(t, "ppc64", "ppc64")
|
||||
}
|
||||
|
||||
func TestRISCVEncoder(t *testing.T) {
|
||||
testEndToEnd(t, "riscv64", "riscvenc")
|
||||
func TestRISCVEndToEnd(t *testing.T) {
|
||||
testEndToEnd(t, "riscv64", "riscv64")
|
||||
}
|
||||
|
||||
func TestRISCVErrors(t *testing.T) {
|
||||
testErrors(t, "riscv64", "riscv64error")
|
||||
}
|
||||
|
||||
func TestS390XEndToEnd(t *testing.T) {
|
||||
|
|
|
|||
|
|
@ -5,20 +5,20 @@
|
|||
package asm
|
||||
|
||||
import (
|
||||
"internal/buildcfg"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"cmd/asm/internal/arch"
|
||||
"cmd/asm/internal/lex"
|
||||
"cmd/internal/obj"
|
||||
"cmd/internal/objabi"
|
||||
)
|
||||
|
||||
// A simple in-out test: Do we print what we parse?
|
||||
|
||||
func setArch(goarch string) (*arch.Arch, *obj.Link) {
|
||||
objabi.GOOS = "linux" // obj can handle this OS for all architectures.
|
||||
objabi.GOARCH = goarch
|
||||
buildcfg.GOOS = "linux" // obj can handle this OS for all architectures.
|
||||
buildcfg.GOARCH = goarch
|
||||
architecture := arch.Set(goarch)
|
||||
if architecture == nil {
|
||||
panic("asm: unrecognized architecture " + goarch)
|
||||
|
|
|
|||
|
|
@ -689,7 +689,11 @@ func (p *Parser) registerShift(name string, prefix rune) int64 {
|
|||
p.errorf("unexpected %s in register shift", tok.String())
|
||||
}
|
||||
if p.arch.Family == sys.ARM64 {
|
||||
return int64(r1&31)<<16 | int64(op)<<22 | int64(uint16(count))
|
||||
off, err := arch.ARM64RegisterShift(r1, op, count)
|
||||
if err != nil {
|
||||
p.errorf(err.Error())
|
||||
}
|
||||
return off
|
||||
} else {
|
||||
return int64((r1 & 15) | op<<5 | count)
|
||||
}
|
||||
|
|
@ -999,15 +1003,17 @@ func (p *Parser) registerIndirect(a *obj.Addr, prefix rune) {
|
|||
p.errorf("unimplemented two-register form")
|
||||
}
|
||||
a.Index = r1
|
||||
if scale == 0 && p.arch.Family == sys.ARM64 {
|
||||
// scale is 1 by default for ARM64
|
||||
a.Scale = 1
|
||||
if scale != 0 && p.arch.Family == sys.ARM64 {
|
||||
p.errorf("arm64 doesn't support scaled register format")
|
||||
} else {
|
||||
a.Scale = int16(scale)
|
||||
}
|
||||
}
|
||||
p.get(')')
|
||||
} else if scale != 0 {
|
||||
if p.arch.Family == sys.ARM64 {
|
||||
p.errorf("arm64 doesn't support scaled register format")
|
||||
}
|
||||
// First (R) was missing, all we have is (R*scale).
|
||||
a.Reg = 0
|
||||
a.Index = r1
|
||||
|
|
|
|||
|
|
@ -25,11 +25,13 @@ func tokenize(s string) [][]lex.Token {
|
|||
|
||||
func TestErroneous(t *testing.T) {
|
||||
|
||||
tests := []struct {
|
||||
type errtest struct {
|
||||
pseudo string
|
||||
operands string
|
||||
expected string
|
||||
}{
|
||||
}
|
||||
|
||||
nonRuntimeTests := []errtest{
|
||||
{"TEXT", "", "expect two or three operands for TEXT"},
|
||||
{"TEXT", "%", "expect two or three operands for TEXT"},
|
||||
{"TEXT", "1, 1", "TEXT symbol \"<erroneous symbol>\" must be a symbol(SB)"},
|
||||
|
|
@ -58,13 +60,33 @@ func TestErroneous(t *testing.T) {
|
|||
{"PCDATA", "1", "expect two operands for PCDATA"},
|
||||
}
|
||||
|
||||
runtimeTests := []errtest{
|
||||
{"TEXT", "foo<ABIInternal>(SB),0", "TEXT \"foo\": ABIInternal requires NOSPLIT"},
|
||||
}
|
||||
|
||||
testcats := []struct {
|
||||
compilingRuntime bool
|
||||
tests []errtest
|
||||
}{
|
||||
{
|
||||
compilingRuntime: false,
|
||||
tests: nonRuntimeTests,
|
||||
},
|
||||
{
|
||||
compilingRuntime: true,
|
||||
tests: runtimeTests,
|
||||
},
|
||||
}
|
||||
|
||||
// Note these errors should be independent of the architecture.
|
||||
// Just run the test with amd64.
|
||||
parser := newParser("amd64")
|
||||
var buf bytes.Buffer
|
||||
parser.errorWriter = &buf
|
||||
|
||||
for _, test := range tests {
|
||||
for _, cat := range testcats {
|
||||
for _, test := range cat.tests {
|
||||
parser.compilingRuntime = cat.compilingRuntime
|
||||
parser.errorCount = 0
|
||||
parser.lineNum++
|
||||
if !parser.pseudo(test.pseudo, tokenize(test.operands)) {
|
||||
|
|
@ -76,5 +98,6 @@ func TestErroneous(t *testing.T) {
|
|||
}
|
||||
buf.Reset()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
68
src/cmd/asm/internal/asm/testdata/amd64dynlinkerror.s
vendored
Normal file
68
src/cmd/asm/internal/asm/testdata/amd64dynlinkerror.s
vendored
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
// Copyright 2021 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.
|
||||
|
||||
// Test to make sure that if we use R15 after it is clobbered by
|
||||
// a global variable access while dynamic linking, we get an error.
|
||||
// See issue 43661.
|
||||
|
||||
TEXT ·a1(SB), 0, $0-0
|
||||
CMPL runtime·writeBarrier(SB), $0
|
||||
MOVL $0, R15
|
||||
RET
|
||||
TEXT ·a2(SB), 0, $0-0
|
||||
CMPL runtime·writeBarrier(SB), $0
|
||||
MOVQ $0, R15
|
||||
RET
|
||||
TEXT ·a3(SB), 0, $0-0
|
||||
CMPL runtime·writeBarrier(SB), $0
|
||||
XORL R15, R15
|
||||
RET
|
||||
TEXT ·a4(SB), 0, $0-0
|
||||
CMPL runtime·writeBarrier(SB), $0
|
||||
XORQ R15, R15
|
||||
RET
|
||||
TEXT ·a5(SB), 0, $0-0
|
||||
CMPL runtime·writeBarrier(SB), $0
|
||||
XORL R15, R15
|
||||
RET
|
||||
TEXT ·a6(SB), 0, $0-0
|
||||
CMPL runtime·writeBarrier(SB), $0
|
||||
POPQ R15
|
||||
PUSHQ R15
|
||||
RET
|
||||
TEXT ·a7(SB), 0, $0-0
|
||||
CMPL runtime·writeBarrier(SB), $0
|
||||
MOVQ R15, AX // ERROR "when dynamic linking, R15 is clobbered by a global variable access and is used here"
|
||||
RET
|
||||
TEXT ·a8(SB), 0, $0-0
|
||||
CMPL runtime·writeBarrier(SB), $0
|
||||
ADDQ AX, R15 // ERROR "when dynamic linking, R15 is clobbered by a global variable access and is used here"
|
||||
RET
|
||||
TEXT ·a9(SB), 0, $0-0
|
||||
CMPL runtime·writeBarrier(SB), $0
|
||||
ORQ R15, R15 // ERROR "when dynamic linking, R15 is clobbered by a global variable access and is used here"
|
||||
RET
|
||||
TEXT ·a10(SB), 0, $0-0
|
||||
CMPL runtime·writeBarrier(SB), $0
|
||||
JEQ one
|
||||
ORQ R15, R15 // ERROR "when dynamic linking, R15 is clobbered by a global variable access and is used here"
|
||||
one:
|
||||
RET
|
||||
TEXT ·a11(SB), 0, $0-0
|
||||
CMPL runtime·writeBarrier(SB), $0
|
||||
JEQ one
|
||||
JMP two
|
||||
one:
|
||||
ORQ R15, R15 // ERROR "when dynamic linking, R15 is clobbered by a global variable access and is used here"
|
||||
two:
|
||||
RET
|
||||
TEXT ·a12(SB), 0, $0-0
|
||||
CMPL runtime·writeBarrier(SB), $0
|
||||
JMP one
|
||||
two:
|
||||
ORQ R15, R15
|
||||
RET
|
||||
one:
|
||||
MOVL $0, R15
|
||||
JMP two
|
||||
124
src/cmd/asm/internal/asm/testdata/arm64.s
vendored
124
src/cmd/asm/internal/asm/testdata/arm64.s
vendored
|
|
@ -64,6 +64,16 @@ TEXT foo(SB), DUPOK|NOSPLIT, $-8
|
|||
CMN R1.SXTX<<2, R10 // 5fe921ab
|
||||
CMPW R2.UXTH<<3, R11 // 7f2d226b
|
||||
CMNW R1.SXTB, R9 // 3f81212b
|
||||
ADD R1<<1, RSP, R3 // e367218b
|
||||
ADDW R1<<2, R3, RSP // 7f48210b
|
||||
SUB R1<<3, RSP // ff6f21cb
|
||||
SUBS R1<<4, RSP, R3 // e37321eb
|
||||
ADDS R1<<1, RSP, R4 // e46721ab
|
||||
CMP R1<<2, RSP // ff6b21eb
|
||||
CMN R1<<3, RSP // ff6f21ab
|
||||
ADDS R1<<1, ZR, R4 // e40701ab
|
||||
ADD R3<<50, ZR, ZR // ffcb038b
|
||||
CMP R4<<24, ZR // ff6304eb
|
||||
CMPW $0x60060, R2 // CMPW $393312, R2 // 1b0c8052db00a0725f001b6b
|
||||
CMPW $40960, R0 // 1f284071
|
||||
CMPW $27745, R2 // 3b8c8d525f001b6b
|
||||
|
|
@ -207,6 +217,18 @@ TEXT foo(SB), DUPOK|NOSPLIT, $-8
|
|||
VUADDW2 V9.B16, V12.H8, V14.H8 // 8e11296e
|
||||
VUADDW2 V13.H8, V20.S4, V30.S4 // 9e126d6e
|
||||
VUADDW2 V21.S4, V24.D2, V29.D2 // 1d13b56e
|
||||
VUMAX V3.B8, V2.B8, V1.B8 // 4164232e
|
||||
VUMAX V3.B16, V2.B16, V1.B16 // 4164236e
|
||||
VUMAX V3.H4, V2.H4, V1.H4 // 4164632e
|
||||
VUMAX V3.H8, V2.H8, V1.H8 // 4164636e
|
||||
VUMAX V3.S2, V2.S2, V1.S2 // 4164a32e
|
||||
VUMAX V3.S4, V2.S4, V1.S4 // 4164a36e
|
||||
VUMIN V3.B8, V2.B8, V1.B8 // 416c232e
|
||||
VUMIN V3.B16, V2.B16, V1.B16 // 416c236e
|
||||
VUMIN V3.H4, V2.H4, V1.H4 // 416c632e
|
||||
VUMIN V3.H8, V2.H8, V1.H8 // 416c636e
|
||||
VUMIN V3.S2, V2.S2, V1.S2 // 416ca32e
|
||||
VUMIN V3.S4, V2.S4, V1.S4 // 416ca36e
|
||||
FCCMPS LT, F1, F2, $1 // 41b4211e
|
||||
FMADDS F1, F3, F2, F4 // 440c011f
|
||||
FMADDD F4, F5, F4, F4 // 8414441f
|
||||
|
|
@ -352,6 +374,9 @@ TEXT foo(SB), DUPOK|NOSPLIT, $-8
|
|||
MOVD $1, ZR
|
||||
MOVD $1, R1
|
||||
MOVK $1, R1
|
||||
MOVD $0x1000100010001000, RSP // MOVD $1152939097061330944, RSP // ff8304b2
|
||||
MOVW $0x10001000, RSP // MOVW $268439552, RSP // ff830432
|
||||
ADDW $0x10001000, R1 // ADDW $268439552, R1 // fb83043221001b0b
|
||||
|
||||
// move a large constant to a Vd.
|
||||
VMOVS $0x80402010, V11 // VMOVS $2151686160, V11
|
||||
|
|
@ -380,13 +405,13 @@ TEXT foo(SB), DUPOK|NOSPLIT, $-8
|
|||
// LD1/ST1
|
||||
VLD1 (R8), [V1.B16, V2.B16] // 01a1404c
|
||||
VLD1.P (R3), [V31.H8, V0.H8] // 7fa4df4c
|
||||
VLD1.P (R8)(R20), [V21.B16, V22.B16] // VLD1.P (R8)(R20*1), [V21.B16,V22.B16] // 15a1d44c
|
||||
VLD1.P (R8)(R20), [V21.B16, V22.B16] // 15a1d44c
|
||||
VLD1.P 64(R1), [V5.B16, V6.B16, V7.B16, V8.B16] // 2520df4c
|
||||
VLD1.P 1(R0), V4.B[15] // 041cdf4d
|
||||
VLD1.P 2(R0), V4.H[7] // 0458df4d
|
||||
VLD1.P 4(R0), V4.S[3] // 0490df4d
|
||||
VLD1.P 8(R0), V4.D[1] // 0484df4d
|
||||
VLD1.P (R0)(R1), V4.D[1] // VLD1.P (R0)(R1*1), V4.D[1] // 0484c14d
|
||||
VLD1.P (R0)(R1), V4.D[1] // 0484c14d
|
||||
VLD1 (R0), V4.D[1] // 0484404d
|
||||
VST1.P [V4.S4, V5.S4], 32(R1) // 24a89f4c
|
||||
VST1 [V0.S4, V1.S4], (R0) // 00a8004c
|
||||
|
|
@ -394,29 +419,29 @@ TEXT foo(SB), DUPOK|NOSPLIT, $-8
|
|||
VLD1.P 24(R30), [V3.S2,V4.S2,V5.S2] // c36bdf0c
|
||||
VLD2 (R29), [V23.H8, V24.H8] // b787404c
|
||||
VLD2.P 16(R0), [V18.B8, V19.B8] // 1280df0c
|
||||
VLD2.P (R1)(R2), [V15.S2, V16.S2] // VLD2.P (R1)(R2*1), [V15.S2,V16.S2] // 2f88c20c
|
||||
VLD2.P (R1)(R2), [V15.S2, V16.S2] // 2f88c20c
|
||||
VLD3 (R27), [V11.S4, V12.S4, V13.S4] // 6b4b404c
|
||||
VLD3.P 48(RSP), [V11.S4, V12.S4, V13.S4] // eb4bdf4c
|
||||
VLD3.P (R30)(R2), [V14.D2, V15.D2, V16.D2] // VLD3.P (R30)(R2*1), [V14.D2,V15.D2,V16.D2] // ce4fc24c
|
||||
VLD3.P (R30)(R2), [V14.D2, V15.D2, V16.D2] // ce4fc24c
|
||||
VLD4 (R15), [V10.H4, V11.H4, V12.H4, V13.H4] // ea05400c
|
||||
VLD4.P 32(R24), [V31.B8, V0.B8, V1.B8, V2.B8] // 1f03df0c
|
||||
VLD4.P (R13)(R9), [V14.S2, V15.S2, V16.S2, V17.S2] // VLD4.P (R13)(R9*1), [V14.S2,V15.S2,V16.S2,V17.S2] // ae09c90c
|
||||
VLD4.P (R13)(R9), [V14.S2, V15.S2, V16.S2, V17.S2] // ae09c90c
|
||||
VLD1R (R1), [V9.B8] // 29c0400d
|
||||
VLD1R.P (R1), [V9.B8] // 29c0df0d
|
||||
VLD1R.P 1(R1), [V2.B8] // 22c0df0d
|
||||
VLD1R.P 2(R1), [V2.H4] // 22c4df0d
|
||||
VLD1R (R0), [V0.B16] // 00c0404d
|
||||
VLD1R.P (R0), [V0.B16] // 00c0df4d
|
||||
VLD1R.P (R15)(R1), [V15.H4] // VLD1R.P (R15)(R1*1), [V15.H4] // efc5c10d
|
||||
VLD1R.P (R15)(R1), [V15.H4] // efc5c10d
|
||||
VLD2R (R15), [V15.H4, V16.H4] // efc5600d
|
||||
VLD2R.P 16(R0), [V0.D2, V1.D2] // 00ccff4d
|
||||
VLD2R.P (R0)(R5), [V31.D1, V0.D1] // VLD2R.P (R0)(R5*1), [V31.D1, V0.D1] // 1fcce50d
|
||||
VLD2R.P (R0)(R5), [V31.D1, V0.D1] // 1fcce50d
|
||||
VLD3R (RSP), [V31.S2, V0.S2, V1.S2] // ffeb400d
|
||||
VLD3R.P 6(R15), [V15.H4, V16.H4, V17.H4] // efe5df0d
|
||||
VLD3R.P (R15)(R6), [V15.H8, V16.H8, V17.H8] // VLD3R.P (R15)(R6*1), [V15.H8, V16.H8, V17.H8] // efe5c64d
|
||||
VLD3R.P (R15)(R6), [V15.H8, V16.H8, V17.H8] // efe5c64d
|
||||
VLD4R (R0), [V0.B8, V1.B8, V2.B8, V3.B8] // 00e0600d
|
||||
VLD4R.P 16(RSP), [V31.S4, V0.S4, V1.S4, V2.S4] // ffebff4d
|
||||
VLD4R.P (R15)(R9), [V15.H4, V16.H4, V17.H4, V18.H4] // VLD4R.P (R15)(R9*1), [V15.H4, V16.H4, V17.H4, V18.H4] // efe5e90d
|
||||
VLD4R.P (R15)(R9), [V15.H4, V16.H4, V17.H4, V18.H4] // efe5e90d
|
||||
VST1.P [V24.S2], 8(R2) // 58789f0c
|
||||
VST1 [V29.S2, V30.S2], (R29) // bdab000c
|
||||
VST1 [V14.H4, V15.H4, V16.H4], (R27) // 6e67000c
|
||||
|
|
@ -424,17 +449,17 @@ TEXT foo(SB), DUPOK|NOSPLIT, $-8
|
|||
VST1.P V4.H[7], 2(R0) // 04589f4d
|
||||
VST1.P V4.S[3], 4(R0) // 04909f4d
|
||||
VST1.P V4.D[1], 8(R0) // 04849f4d
|
||||
VST1.P V4.D[1], (R0)(R1) // VST1.P V4.D[1], (R0)(R1*1) // 0484814d
|
||||
VST1.P V4.D[1], (R0)(R1) // 0484814d
|
||||
VST1 V4.D[1], (R0) // 0484004d
|
||||
VST2 [V22.H8, V23.H8], (R23) // f686004c
|
||||
VST2.P [V14.H4, V15.H4], 16(R17) // 2e869f0c
|
||||
VST2.P [V14.H4, V15.H4], (R3)(R17) // VST2.P [V14.H4,V15.H4], (R3)(R17*1) // 6e84910c
|
||||
VST2.P [V14.H4, V15.H4], (R3)(R17) // 6e84910c
|
||||
VST3 [V1.D2, V2.D2, V3.D2], (R11) // 614d004c
|
||||
VST3.P [V18.S4, V19.S4, V20.S4], 48(R25) // 324b9f4c
|
||||
VST3.P [V19.B8, V20.B8, V21.B8], (R3)(R7) // VST3.P [V19.B8, V20.B8, V21.B8], (R3)(R7*1) // 7340870c
|
||||
VST3.P [V19.B8, V20.B8, V21.B8], (R3)(R7) // 7340870c
|
||||
VST4 [V22.D2, V23.D2, V24.D2, V25.D2], (R3) // 760c004c
|
||||
VST4.P [V14.D2, V15.D2, V16.D2, V17.D2], 64(R15) // ee0d9f4c
|
||||
VST4.P [V24.B8, V25.B8, V26.B8, V27.B8], (R3)(R23) // VST4.P [V24.B8, V25.B8, V26.B8, V27.B8], (R3)(R23*1) // 7800970c
|
||||
VST4.P [V24.B8, V25.B8, V26.B8, V27.B8], (R3)(R23) // 7800970c
|
||||
|
||||
// pre/post-indexed
|
||||
FMOVS.P F20, 4(R0) // 144400bc
|
||||
|
|
@ -521,29 +546,29 @@ TEXT foo(SB), DUPOK|NOSPLIT, $-8
|
|||
|
||||
// shifted or extended register offset.
|
||||
MOVD (R2)(R6.SXTW), R4 // 44c866f8
|
||||
MOVD (R3)(R6), R5 // MOVD (R3)(R6*1), R5 // 656866f8
|
||||
MOVD (R2)(R6), R4 // MOVD (R2)(R6*1), R4 // 446866f8
|
||||
MOVD (R3)(R6), R5 // 656866f8
|
||||
MOVD (R2)(R6), R4 // 446866f8
|
||||
MOVWU (R19)(R20<<2), R20 // 747a74b8
|
||||
MOVD (R2)(R6<<3), R4 // 447866f8
|
||||
MOVD (R3)(R7.SXTX<<3), R8 // 68f867f8
|
||||
MOVWU (R5)(R4.UXTW), R10 // aa4864b8
|
||||
MOVBU (R3)(R9.UXTW), R8 // 68486938
|
||||
MOVBU (R5)(R8), R10 // MOVBU (R5)(R8*1), R10 // aa686838
|
||||
MOVBU (R5)(R8), R10 // aa686838
|
||||
MOVHU (R2)(R7.SXTW<<1), R11 // 4bd86778
|
||||
MOVHU (R1)(R2<<1), R5 // 25786278
|
||||
MOVB (R9)(R3.UXTW), R6 // 2649a338
|
||||
MOVB (R10)(R6), R15 // MOVB (R10)(R6*1), R15 // 4f69a638
|
||||
MOVB (R10)(R6), R15 // 4f69a638
|
||||
MOVB (R29)(R30<<0), R14 // ae7bbe38
|
||||
MOVB (R29)(R30), R14 // MOVB (R29)(R30*1), R14 // ae6bbe38
|
||||
MOVB (R29)(R30), R14 // ae6bbe38
|
||||
MOVH (R5)(R7.SXTX<<1), R19 // b3f8a778
|
||||
MOVH (R8)(R4<<1), R10 // 0a79a478
|
||||
MOVW (R9)(R8.SXTW<<2), R19 // 33d9a8b8
|
||||
MOVW (R1)(R4.SXTX), R11 // 2be8a4b8
|
||||
MOVW (R1)(R4.SXTX), ZR // 3fe8a4b8
|
||||
MOVW (R2)(R5), R12 // MOVW (R2)(R5*1), R12 // 4c68a5b8
|
||||
FMOVS (R2)(R6), F4 // FMOVS (R2)(R6*1), F4 // 446866bc
|
||||
MOVW (R2)(R5), R12 // 4c68a5b8
|
||||
FMOVS (R2)(R6), F4 // 446866bc
|
||||
FMOVS (R2)(R6<<2), F4 // 447866bc
|
||||
FMOVD (R2)(R6), F4 // FMOVD (R2)(R6*1), F4 // 446866fc
|
||||
FMOVD (R2)(R6), F4 // 446866fc
|
||||
FMOVD (R2)(R6<<3), F4 // 447866fc
|
||||
|
||||
MOVD R5, (R2)(R6<<3) // 457826f8
|
||||
|
|
@ -553,15 +578,15 @@ TEXT foo(SB), DUPOK|NOSPLIT, $-8
|
|||
MOVW R7, (R3)(R4.SXTW) // 67c824b8
|
||||
MOVB R4, (R2)(R6.SXTX) // 44e82638
|
||||
MOVB R8, (R3)(R9.UXTW) // 68482938
|
||||
MOVB R10, (R5)(R8) // MOVB R10, (R5)(R8*1) // aa682838
|
||||
MOVB R10, (R5)(R8) // aa682838
|
||||
MOVH R11, (R2)(R7.SXTW<<1) // 4bd82778
|
||||
MOVH R5, (R1)(R2<<1) // 25782278
|
||||
MOVH R7, (R2)(R5.SXTX<<1) // 47f82578
|
||||
MOVH R8, (R3)(R6.UXTW) // 68482678
|
||||
MOVB R4, (R2)(R6.SXTX) // 44e82638
|
||||
FMOVS F4, (R2)(R6) // FMOVS F4, (R2)(R6*1) // 446826bc
|
||||
FMOVS F4, (R2)(R6) // 446826bc
|
||||
FMOVS F4, (R2)(R6<<2) // 447826bc
|
||||
FMOVD F4, (R2)(R6) // FMOVD F4, (R2)(R6*1) // 446826fc
|
||||
FMOVD F4, (R2)(R6) // 446826fc
|
||||
FMOVD F4, (R2)(R6<<3) // 447826fc
|
||||
|
||||
// vmov
|
||||
|
|
@ -571,9 +596,12 @@ TEXT foo(SB), DUPOK|NOSPLIT, $-8
|
|||
VMOV R20, V1.S[0] // 811e044e
|
||||
VMOV R20, V1.S[1] // 811e0c4e
|
||||
VMOV R1, V9.H4 // 290c020e
|
||||
VDUP R1, V9.H4 // 290c020e
|
||||
VMOV R22, V11.D2 // cb0e084e
|
||||
VDUP R22, V11.D2 // cb0e084e
|
||||
VMOV V2.B16, V4.B16 // 441ca24e
|
||||
VMOV V20.S[0], V20 // 9406045e
|
||||
VDUP V20.S[0], V20 // 9406045e
|
||||
VMOV V12.D[0], V12.D[1] // 8c05186e
|
||||
VMOV V10.S[0], V12.S[1] // 4c050c6e
|
||||
VMOV V9.H[0], V12.H[1] // 2c05066e
|
||||
|
|
@ -982,6 +1010,54 @@ again:
|
|||
FSTPS (F3, F4), x(SB)
|
||||
FSTPS (F3, F4), x+8(SB)
|
||||
|
||||
// FLDPQ/FSTPQ
|
||||
FLDPQ -4000(R0), (F1, F2) // 1b803ed1610b40ad
|
||||
FLDPQ -1024(R0), (F1, F2) // 010860ad
|
||||
FLDPQ (R0), (F1, F2) // 010840ad
|
||||
FLDPQ 16(R0), (F1, F2) // 018840ad
|
||||
FLDPQ -16(R0), (F1, F2) // 01887fad
|
||||
FLDPQ.W 32(R0), (F1, F2) // 0108c1ad
|
||||
FLDPQ.P 32(R0), (F1, F2) // 0108c1ac
|
||||
FLDPQ 11(R0), (F1, F2) // 1b2c0091610b40ad
|
||||
FLDPQ 1024(R0), (F1, F2) // 1b001091610b40ad
|
||||
FLDPQ 4104(R0), (F1, F2)
|
||||
FLDPQ -4000(RSP), (F1, F2) // fb833ed1610b40ad
|
||||
FLDPQ -1024(RSP), (F1, F2) // e10b60ad
|
||||
FLDPQ (RSP), (F1, F2) // e10b40ad
|
||||
FLDPQ 16(RSP), (F1, F2) // e18b40ad
|
||||
FLDPQ -16(RSP), (F1, F2) // e18b7fad
|
||||
FLDPQ.W 32(RSP), (F1, F2) // e10bc1ad
|
||||
FLDPQ.P 32(RSP), (F1, F2) // e10bc1ac
|
||||
FLDPQ 11(RSP), (F1, F2) // fb2f0091610b40ad
|
||||
FLDPQ 1024(RSP), (F1, F2) // fb031091610b40ad
|
||||
FLDPQ 4104(RSP), (F1, F2)
|
||||
FLDPQ -31(R0), (F1, F2) // 1b7c00d1610b40ad
|
||||
FLDPQ -4(R0), (F1, F2) // 1b1000d1610b40ad
|
||||
FLDPQ x(SB), (F1, F2)
|
||||
FLDPQ x+8(SB), (F1, F2)
|
||||
FSTPQ (F3, F4), -4000(R5) // bb803ed1631300ad
|
||||
FSTPQ (F3, F4), -1024(R5) // a31020ad
|
||||
FSTPQ (F3, F4), (R5) // a31000ad
|
||||
FSTPQ (F3, F4), 16(R5) // a39000ad
|
||||
FSTPQ (F3, F4), -16(R5) // a3903fad
|
||||
FSTPQ.W (F3, F4), 32(R5) // a31081ad
|
||||
FSTPQ.P (F3, F4), 32(R5) // a31081ac
|
||||
FSTPQ (F3, F4), 11(R5) // bb2c0091631300ad
|
||||
FSTPQ (F3, F4), 1024(R5) // bb001091631300ad
|
||||
FSTPQ (F3, F4), 4104(R5)
|
||||
FSTPQ (F3, F4), -4000(RSP) // fb833ed1631300ad
|
||||
FSTPQ (F3, F4), -1024(RSP) // e31320ad
|
||||
FSTPQ (F3, F4), (RSP) // e31300ad
|
||||
FSTPQ (F3, F4), 16(RSP) // e39300ad
|
||||
FSTPQ (F3, F4), -16(RSP) // e3933fad
|
||||
FSTPQ.W (F3, F4), 32(RSP) // e31381ad
|
||||
FSTPQ.P (F3, F4), 32(RSP) // e31381ac
|
||||
FSTPQ (F3, F4), 11(RSP) // fb2f0091631300ad
|
||||
FSTPQ (F3, F4), 1024(RSP) // fb031091631300ad
|
||||
FSTPQ (F3, F4), 4104(RSP)
|
||||
FSTPQ (F3, F4), x(SB)
|
||||
FSTPQ (F3, F4), x+8(SB)
|
||||
|
||||
// System Register
|
||||
MSR $1, SPSel // bf4100d5
|
||||
MSR $9, DAIFSet // df4903d5
|
||||
|
|
|
|||
46
src/cmd/asm/internal/asm/testdata/arm64enc.s
vendored
46
src/cmd/asm/internal/asm/testdata/arm64enc.s
vendored
|
|
@ -188,7 +188,7 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$-8
|
|||
MOVBU 2916(R24), R3 // 03936d39
|
||||
MOVBU (R19)(R14<<0), R23 // 777a6e38
|
||||
MOVBU (R2)(R8.SXTX), R19 // 53e86838
|
||||
MOVBU (R27)(R23), R14 // MOVBU (R27)(R23*1), R14 // 6e6b7738
|
||||
MOVBU (R27)(R23), R14 // 6e6b7738
|
||||
MOVHU.P 107(R14), R13 // cdb54678
|
||||
MOVHU.W 192(R3), R2 // 620c4c78
|
||||
MOVHU 6844(R4), R19 // 93787579
|
||||
|
|
@ -201,9 +201,9 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$-8
|
|||
MOVB 997(R9), R23 // 37958f39
|
||||
//TODO MOVBW (R2<<1)(R21), R15 // af7ae238
|
||||
//TODO MOVBW (R26)(R0), R21 // 1568fa38
|
||||
MOVB (R5)(R15), R16 // MOVB (R5)(R15*1), R16 // b068af38
|
||||
MOVB (R5)(R15), R16 // b068af38
|
||||
MOVB (R19)(R26.SXTW), R19 // 73caba38
|
||||
MOVB (R29)(R30), R14 // MOVB (R29)(R30*1), R14 // ae6bbe38
|
||||
MOVB (R29)(R30), R14 // ae6bbe38
|
||||
//TODO MOVHW.P 218(R22), R25 // d9a6cd78
|
||||
MOVH.P 179(R23), R5 // e5368b78
|
||||
//TODO MOVHW.W 136(R2), R27 // 5b8cc878
|
||||
|
|
@ -357,12 +357,12 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$-8
|
|||
MOVD R25, -137(R17) // 397217f8
|
||||
MOVW R4, (R12)(R22.UXTW<<2) // 845936b8
|
||||
MOVD R27, (R5)(R15.UXTW<<3) // bb582ff8
|
||||
MOVB R2, (R10)(R16) // MOVB R2, (R10)(R16*1) // 42693038
|
||||
MOVB R2, (R29)(R26) // MOVB R2, (R29)(R26*1) // a26b3a38
|
||||
MOVB R2, (R10)(R16) // 42693038
|
||||
MOVB R2, (R29)(R26) // a26b3a38
|
||||
MOVH R11, -80(R23) // eb021b78
|
||||
MOVH R11, (R27)(R14.SXTW<<1) // 6bdb2e78
|
||||
MOVB R19, (R0)(R4) // MOVB R19, (R0)(R4*1) // 13682438
|
||||
MOVB R1, (R6)(R4) // MOVB R1, (R6)(R4*1) // c1682438
|
||||
MOVB R19, (R0)(R4) // 13682438
|
||||
MOVB R1, (R6)(R4) // c1682438
|
||||
MOVH R3, (R11)(R13<<1) // 63792d78
|
||||
//TODO STTR 55(R4), R29 // 9d7803b8
|
||||
//TODO STTR 124(R5), R25 // b9c807f8
|
||||
|
|
@ -669,6 +669,7 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$-8
|
|||
VCMEQ V24.S4, V13.S4, V12.S4 // ac8db86e
|
||||
VCNT V13.B8, V11.B8 // ab59200e
|
||||
VMOV V31.B[15], V18 // f2071f5e
|
||||
VDUP V31.B[15], V18 // f2071f5e
|
||||
VDUP V31.B[13], V20.B16 // f4071b4e
|
||||
VEOR V4.B8, V18.B8, V7.B8 // 471e242e
|
||||
VEXT $4, V2.B8, V1.B8, V3.B8 // 2320022e
|
||||
|
|
@ -679,27 +680,28 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$-8
|
|||
VLD1 (R24), [V18.D1, V19.D1, V20.D1] // 126f400c
|
||||
VLD1 (R29), [V14.D1, V15.D1, V16.D1, V17.D1] // ae2f400c
|
||||
VLD1.P 16(R23), [V1.B16] // e172df4c
|
||||
VLD1.P (R6)(R11), [V31.D1] // VLD1.P (R6)(R11*1), [V31.D1] // df7ccb0c
|
||||
VLD1.P (R6)(R11), [V31.D1] // df7ccb0c
|
||||
VLD1.P 16(R7), [V31.D1, V0.D1] // ffacdf0c
|
||||
VLD1.P (R19)(R4), [V24.B8, V25.B8] // VLD1.P (R19)(R4*1), [V24.B8, V25.B8] // 78a2c40c
|
||||
VLD1.P (R20)(R8), [V7.H8, V8.H8, V9.H8] // VLD1.P (R20)(R8*1), [V7.H8, V8.H8, V9.H8] // 8766c84c
|
||||
VLD1.P (R19)(R4), [V24.B8, V25.B8] // 78a2c40c
|
||||
VLD1.P (R20)(R8), [V7.H8, V8.H8, V9.H8] // 8766c84c
|
||||
VLD1.P 32(R30), [V5.B8, V6.B8, V7.B8, V8.B8] // c523df0c
|
||||
VLD1 (R19), V14.B[15] // 6e1e404d
|
||||
VLD1 (R29), V0.H[1] // a04b400d
|
||||
VLD1 (R27), V2.S[0] // 6283400d
|
||||
VLD1 (R21), V5.D[1] // a586404d
|
||||
VLD1.P 1(R19), V10.B[14] // 6a1adf4d
|
||||
VLD1.P (R3)(R14), V16.B[11] // VLD1.P (R3)(R14*1), V16.B[11] // 700cce4d
|
||||
VLD1.P (R3)(R14), V16.B[11] // 700cce4d
|
||||
VLD1.P 2(R1), V28.H[2] // 3c50df0d
|
||||
VLD1.P (R13)(R20), V9.H[2] // VLD1.P (R13)(R20*1), V9.H[2] // a951d40d
|
||||
VLD1.P (R13)(R20), V9.H[2] // a951d40d
|
||||
VLD1.P 4(R17), V1.S[3] // 2192df4d
|
||||
VLD1.P (R14)(R2), V17.S[2] // VLD1.P (R14)(R2*1), V17.S[2] // d181c24d
|
||||
VLD1.P (R14)(R2), V17.S[2] // d181c24d
|
||||
VLD1.P 8(R5), V30.D[1] // be84df4d
|
||||
VLD1.P (R27)(R13), V27.D[0] // VLD1.P (R27)(R13*1), V27.D[0] // 7b87cd0d
|
||||
VLD1.P (R27)(R13), V27.D[0] // 7b87cd0d
|
||||
//TODO FMOVS.P -29(RSP), F8 // e8375ebc
|
||||
//TODO FMOVS.W 71(R29), F28 // bc7f44bc
|
||||
FMOVS 6160(R4), F23 // 971058bd
|
||||
VMOV V18.B[10], V27 // 5b06155e
|
||||
VDUP V18.B[10], V27 // 5b06155e
|
||||
VMOV V12.B[2], V28.B[12] // 9c15196e
|
||||
VMOV R30, V4.B[13] // c41f1b4e
|
||||
VMOV V2.B16, V4.B16 // 441ca24e
|
||||
|
|
@ -732,25 +734,25 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$-8
|
|||
VSHL $7, V22.D2, V25.D2 // d956474f
|
||||
VST1 [V14.H4, V15.H4, V16.H4], (R27) // 6e67000c
|
||||
VST1 [V2.S4, V3.S4, V4.S4, V5.S4], (R14) // c229004c
|
||||
VST1.P [V25.S4], (R7)(R29) // VST1.P [V25.S4], (R7)(R29*1) // f9789d4c
|
||||
VST1.P [V25.S4], (R7)(R29) // f9789d4c
|
||||
VST1.P [V25.D2, V26.D2], 32(R7) // f9ac9f4c
|
||||
VST1.P [V14.D1, V15.D1], (R7)(R23) // VST1.P [V14.D1, V15.D1], (R7)(R23*1) // eeac970c
|
||||
VST1.P [V14.D1, V15.D1], (R7)(R23) // eeac970c
|
||||
VST1.P [V25.D2, V26.D2, V27.D2], 48(R27) // 796f9f4c
|
||||
VST1.P [V13.H8, V14.H8, V15.H8], (R3)(R14) // VST1.P [V13.H8, V14.H8, V15.H8], (R3)(R14*1) // 6d648e4c
|
||||
VST1.P [V13.H8, V14.H8, V15.H8], (R3)(R14) // 6d648e4c
|
||||
VST1.P [V16.S4, V17.S4, V18.S4, V19.S4], 64(R6) // d0289f4c
|
||||
VST1.P [V19.H4, V20.H4, V21.H4, V22.H4], (R4)(R16) // VST1.P [V19.H4, V20.H4, V21.H4, V22.H4], (R4)(R16*1) // 9324900c
|
||||
VST1.P [V19.H4, V20.H4, V21.H4, V22.H4], (R4)(R16) // 9324900c
|
||||
VST1 V12.B[3], (R1) // 2c0c000d
|
||||
VST1 V12.B[3], (R1) // 2c0c000d
|
||||
VST1 V25.S[2], (R20) // 9982004d
|
||||
VST1 V9.D[1], (RSP) // e987004d
|
||||
VST1.P V30.B[6], 1(R3) // 7e189f0d
|
||||
VST1.P V8.B[0], (R3)(R21) // VST1.P V8.B[0], (R3)(R21*1) // 6800950d
|
||||
VST1.P V8.B[0], (R3)(R21) // 6800950d
|
||||
VST1.P V15.H[5], 2(R10) // 4f499f4d
|
||||
VST1.P V1.H[7], (R23)(R11) // VST1.P V1.H[7], (R23)(R11*1) // e15a8b4d
|
||||
VST1.P V1.H[7], (R23)(R11) // e15a8b4d
|
||||
VST1.P V26.S[0], 4(R11) // 7a819f0d
|
||||
VST1.P V9.S[1], (R16)(R21) // VST1.P V9.S[1], (R16)(R21*1) // 0992950d
|
||||
VST1.P V9.S[1], (R16)(R21) // 0992950d
|
||||
VST1.P V16.D[0], 8(R9) // 30859f0d
|
||||
VST1.P V23.D[1], (R21)(R16) // VST1.P V23.D[1], (R21)(R16*1) // b786904d
|
||||
VST1.P V23.D[1], (R21)(R16) // b786904d
|
||||
VSUB V1, V12, V23 // 9785e17e
|
||||
VUADDLV V31.S4, V11 // eb3bb06e
|
||||
UCVTFWS R11, F19 // 7301231e
|
||||
|
|
|
|||
66
src/cmd/asm/internal/asm/testdata/arm64error.s
vendored
66
src/cmd/asm/internal/asm/testdata/arm64error.s
vendored
|
|
@ -8,10 +8,48 @@ TEXT errors(SB),$0
|
|||
ADDSW R7->32, R14, R13 // ERROR "shift amount out of range 0 to 31"
|
||||
ADD R1.UXTB<<5, R2, R3 // ERROR "shift amount out of range 0 to 4"
|
||||
ADDS R1.UXTX<<7, R2, R3 // ERROR "shift amount out of range 0 to 4"
|
||||
ADDS R5, R6, RSP // ERROR "illegal destination register"
|
||||
SUBS R5, R6, RSP // ERROR "illegal destination register"
|
||||
ADDSW R5, R6, RSP // ERROR "illegal destination register"
|
||||
SUBSW R5, R6, RSP // ERROR "illegal destination register"
|
||||
ADDS $0xff, R6, RSP // ERROR "illegal destination register"
|
||||
ADDS $0xffff0, R6, RSP // ERROR "illegal destination register"
|
||||
ADDS $0x1000100010001000, R6, RSP // ERROR "illegal destination register"
|
||||
ADDS $0x10001000100011, R6, RSP // ERROR "illegal destination register"
|
||||
ADDSW $0xff, R6, RSP // ERROR "illegal destination register"
|
||||
ADDSW $0xffff0, R6, RSP // ERROR "illegal destination register"
|
||||
ADDSW $0x1000100010001000, R6, RSP // ERROR "illegal destination register"
|
||||
ADDSW $0x10001000100011, R6, RSP // ERROR "illegal destination register"
|
||||
SUBS $0xff, R6, RSP // ERROR "illegal destination register"
|
||||
SUBS $0xffff0, R6, RSP // ERROR "illegal destination register"
|
||||
SUBS $0x1000100010001000, R6, RSP // ERROR "illegal destination register"
|
||||
SUBS $0x10001000100011, R6, RSP // ERROR "illegal destination register"
|
||||
SUBSW $0xff, R6, RSP // ERROR "illegal destination register"
|
||||
SUBSW $0xffff0, R6, RSP // ERROR "illegal destination register"
|
||||
SUBSW $0x1000100010001000, R6, RSP // ERROR "illegal destination register"
|
||||
SUBSW $0x10001000100011, R6, RSP // ERROR "illegal destination register"
|
||||
AND $0x22220000, R2, RSP // ERROR "illegal combination"
|
||||
ANDS $0x22220000, R2, RSP // ERROR "illegal combination"
|
||||
ADD R1, R2, R3, R4 // ERROR "illegal combination"
|
||||
BICW R7@>33, R5, R16 // ERROR "shift amount out of range 0 to 31"
|
||||
NEGW R7<<33, R5 // ERROR "shift amount out of range 0 to 31"
|
||||
NEGSW R7<<33, R5 // ERROR "shift amount out of range 0 to 31"
|
||||
ADD R7@>2, R5, R16 // ERROR "unsupported shift operator"
|
||||
ADDW R7@>2, R5, R16 // ERROR "unsupported shift operator"
|
||||
ADDS R7@>2, R5, R16 // ERROR "unsupported shift operator"
|
||||
ADDSW R7@>2, R5, R16 // ERROR "unsupported shift operator"
|
||||
SUB R7@>2, R5, R16 // ERROR "unsupported shift operator"
|
||||
SUBW R7@>2, R5, R16 // ERROR "unsupported shift operator"
|
||||
SUBS R7@>2, R5, R16 // ERROR "unsupported shift operator"
|
||||
SUBSW R7@>2, R5, R16 // ERROR "unsupported shift operator"
|
||||
CMP R7@>2, R5 // ERROR "unsupported shift operator"
|
||||
CMPW R7@>2, R5 // ERROR "unsupported shift operator"
|
||||
CMN R7@>2, R5 // ERROR "unsupported shift operator"
|
||||
CMNW R7@>2, R5 // ERROR "unsupported shift operator"
|
||||
NEG R7@>2, R5 // ERROR "unsupported shift operator"
|
||||
NEGW R7@>2, R5 // ERROR "unsupported shift operator"
|
||||
NEGS R7@>2, R5 // ERROR "unsupported shift operator"
|
||||
NEGSW R7@>2, R5 // ERROR "unsupported shift operator"
|
||||
CINC CS, R2, R3, R4 // ERROR "illegal combination"
|
||||
CSEL LT, R1, R2 // ERROR "illegal combination"
|
||||
LDP.P 8(R2), (R2, R3) // ERROR "constrained unpredictable behavior"
|
||||
|
|
@ -21,8 +59,8 @@ TEXT errors(SB),$0
|
|||
LDP (R0), (R3, ZR) // ERROR "invalid register pair"
|
||||
LDXPW (RSP), (R2, R2) // ERROR "constrained unpredictable behavior"
|
||||
LDAXPW (R5), (R2, R2) // ERROR "constrained unpredictable behavior"
|
||||
MOVD.P 300(R2), R3 // ERROR "offset out of range [-255,254]"
|
||||
MOVD.P R3, 344(R2) // ERROR "offset out of range [-255,254]"
|
||||
MOVD.P 300(R2), R3 // ERROR "offset out of range [-256,255]"
|
||||
MOVD.P R3, 344(R2) // ERROR "offset out of range [-256,255]"
|
||||
MOVD (R3)(R7.SXTX<<2), R8 // ERROR "invalid index shift amount"
|
||||
MOVWU (R5)(R4.UXTW<<3), R10 // ERROR "invalid index shift amount"
|
||||
MOVWU (R5)(R4<<1), R10 // ERROR "invalid index shift amount"
|
||||
|
|
@ -58,13 +96,13 @@ TEXT errors(SB),$0
|
|||
VMOV V8.H[9], R3 // ERROR "register element index out of range 0 to 7"
|
||||
VMOV V8.S[4], R3 // ERROR "register element index out of range 0 to 3"
|
||||
VMOV V8.D[2], R3 // ERROR "register element index out of range 0 to 1"
|
||||
VDUP V8.B[16], R3.B16 // ERROR "register element index out of range 0 to 15"
|
||||
VDUP V8.B[17], R3.B8 // ERROR "register element index out of range 0 to 15"
|
||||
VDUP V8.H[9], R3.H4 // ERROR "register element index out of range 0 to 7"
|
||||
VDUP V8.H[9], R3.H8 // ERROR "register element index out of range 0 to 7"
|
||||
VDUP V8.S[4], R3.S2 // ERROR "register element index out of range 0 to 3"
|
||||
VDUP V8.S[4], R3.S4 // ERROR "register element index out of range 0 to 3"
|
||||
VDUP V8.D[2], R3.D2 // ERROR "register element index out of range 0 to 1"
|
||||
VDUP V8.B[16], V3.B16 // ERROR "register element index out of range 0 to 15"
|
||||
VDUP V8.B[17], V3.B8 // ERROR "register element index out of range 0 to 15"
|
||||
VDUP V8.H[9], V3.H4 // ERROR "register element index out of range 0 to 7"
|
||||
VDUP V8.H[9], V3.H8 // ERROR "register element index out of range 0 to 7"
|
||||
VDUP V8.S[4], V3.S2 // ERROR "register element index out of range 0 to 3"
|
||||
VDUP V8.S[4], V3.S4 // ERROR "register element index out of range 0 to 3"
|
||||
VDUP V8.D[2], V3.D2 // ERROR "register element index out of range 0 to 1"
|
||||
VFMLA V1.D2, V12.D2, V3.S2 // ERROR "operand mismatch"
|
||||
VFMLA V1.S2, V12.S2, V3.D2 // ERROR "operand mismatch"
|
||||
VFMLA V1.S4, V12.S2, V3.D2 // ERROR "operand mismatch"
|
||||
|
|
@ -109,6 +147,9 @@ TEXT errors(SB),$0
|
|||
VREV16 V1.D1, V2.D1 // ERROR "invalid arrangement"
|
||||
VREV16 V1.B8, V2.B16 // ERROR "invalid arrangement"
|
||||
VREV16 V1.H4, V2.H4 // ERROR "invalid arrangement"
|
||||
FLDPQ (R0), (R1, R2) // ERROR "invalid register pair"
|
||||
FLDPQ (R1), (F2, F2) // ERROR "constrained unpredictable behavior"
|
||||
FSTPQ (R1, R2), (R0) // ERROR "invalid register pair"
|
||||
FLDPD (R0), (R1, R2) // ERROR "invalid register pair"
|
||||
FLDPD (R1), (F2, F2) // ERROR "constrained unpredictable behavior"
|
||||
FLDPS (R2), (F3, F3) // ERROR "constrained unpredictable behavior"
|
||||
|
|
@ -355,10 +396,17 @@ TEXT errors(SB),$0
|
|||
VBIF V0.D2, V1.D2, V2.D2 // ERROR "invalid arrangement"
|
||||
VUADDW V9.B8, V12.H8, V14.B8 // ERROR "invalid arrangement"
|
||||
VUADDW2 V9.B8, V12.S4, V14.S4 // ERROR "operand mismatch"
|
||||
VUMAX V1.D2, V2.D2, V3.D2 // ERROR "invalid arrangement"
|
||||
VUMIN V1.D2, V2.D2, V3.D2 // ERROR "invalid arrangement"
|
||||
VUMAX V1.B8, V2.B8, V3.B16 // ERROR "operand mismatch"
|
||||
VUMIN V1.H4, V2.S4, V3.H4 // ERROR "operand mismatch"
|
||||
VSLI $64, V7.D2, V8.D2 // ERROR "shift out of range"
|
||||
VUSRA $0, V7.D2, V8.D2 // ERROR "shift out of range"
|
||||
CASPD (R3, R4), (R2), (R8, R9) // ERROR "source register pair must start from even register"
|
||||
CASPD (R2, R3), (R2), (R9, R10) // ERROR "destination register pair must start from even register"
|
||||
CASPD (R2, R4), (R2), (R8, R9) // ERROR "source register pair must be contiguous"
|
||||
CASPD (R2, R3), (R2), (R8, R10) // ERROR "destination register pair must be contiguous"
|
||||
ADD R1>>2, RSP, R3 // ERROR "illegal combination"
|
||||
ADDS R2<<3, R3, RSP // ERROR "unexpected SP reference"
|
||||
CMP R1<<5, RSP // ERROR "the left shift amount out of range 0 to 4"
|
||||
RET
|
||||
|
|
|
|||
8
src/cmd/asm/internal/asm/testdata/mips64.s
vendored
8
src/cmd/asm/internal/asm/testdata/mips64.s
vendored
|
|
@ -407,6 +407,8 @@ label4:
|
|||
SRLV R27, R6, R17 // 03668816
|
||||
SRA R11, R19, R20 // 0173a007
|
||||
SRAV R20, R19, R19 // 02939817
|
||||
ROTR R19, R18, R20 // 0272a046
|
||||
ROTRV R9, R13, R16 // 012d8056
|
||||
|
||||
// LSHW rreg ',' rreg
|
||||
// {
|
||||
|
|
@ -418,6 +420,8 @@ label4:
|
|||
SRLV R27, R6 // 03663016
|
||||
SRA R11, R19 // 01739807
|
||||
SRAV R20, R19 // 02939817
|
||||
ROTR R20, R19 // 02939846
|
||||
ROTRV R16, R9 // 02094856
|
||||
|
||||
// LSHW imm ',' sreg ',' rreg
|
||||
// {
|
||||
|
|
@ -429,6 +433,8 @@ label4:
|
|||
SRLV $31, R6, R17 // 00068ffa
|
||||
SRA $8, R8, R19 // 00089a03
|
||||
SRAV $19, R8, R7 // 00083cfb
|
||||
ROTR $12, R8, R3 // 00281b02
|
||||
ROTRV $8, R22, R22 // 0036b23a
|
||||
|
||||
// LSHW imm ',' rreg
|
||||
// {
|
||||
|
|
@ -440,6 +446,8 @@ label4:
|
|||
SRLV $31, R17 // 00118ffa
|
||||
SRA $3, R12 // 000c60c3
|
||||
SRAV $12, R3 // 00031b3b
|
||||
ROTR $12, R8 // 00284302
|
||||
ROTRV $63, R22 // 0036b7fe
|
||||
|
||||
|
||||
// LAND/LXOR/LNOR/LOR rreg ',' rreg
|
||||
|
|
|
|||
19
src/cmd/asm/internal/asm/testdata/ppc64.s
vendored
19
src/cmd/asm/internal/asm/testdata/ppc64.s
vendored
|
|
@ -41,6 +41,8 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$0
|
|||
MOVDBR (R3)(R4), R5 // 7ca41c28
|
||||
MOVWBR (R3)(R4), R5 // 7ca41c2c
|
||||
MOVHBR (R3)(R4), R5 // 7ca41e2c
|
||||
MOVD $foo+4009806848(FP), R5 // 3ca1ef0138a5cc20
|
||||
MOVD $foo(SB), R5 // 3ca0000038a50000
|
||||
|
||||
MOVDU 8(R3), R4 // e8830009
|
||||
MOVDU (R3)(R4), R5 // 7ca4186a
|
||||
|
|
@ -77,6 +79,15 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$0
|
|||
MOVBU R4, 1(R3) // 9c830001
|
||||
MOVBU R5, (R3)(R4) // 7ca419ee
|
||||
|
||||
MOVB $0, R4 // 38800000
|
||||
MOVBZ $0, R4 // 38800000
|
||||
MOVH $0, R4 // 38800000
|
||||
MOVHZ $0, R4 // 38800000
|
||||
MOVW $0, R4 // 38800000
|
||||
MOVWZ $0, R4 // 38800000
|
||||
MOVD $0, R4 // 38800000
|
||||
MOVD $0, R0 // 38000000
|
||||
|
||||
ADD $1, R3 // 38630001
|
||||
ADD $1, R3, R4 // 38830001
|
||||
ADD $-1, R4 // 3884ffff
|
||||
|
|
@ -280,11 +291,17 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$0
|
|||
ROTLW R3, R4, R5 // 5c85183e
|
||||
EXTSWSLI $3, R4, R5 // 7c851ef4
|
||||
RLWMI $7, R3, $65535, R6 // 50663c3e
|
||||
RLWMI $7, R3, $16, $31, R6 // 50663c3e
|
||||
RLWMICC $7, R3, $65535, R6 // 50663c3f
|
||||
RLWMICC $7, R3, $16, $31, R6 // 50663c3f
|
||||
RLWNM $3, R4, $7, R6 // 54861f7e
|
||||
RLWNM $3, R4, $29, $31, R6 // 54861f7e
|
||||
RLWNM R3, R4, $7, R6 // 5c861f7e
|
||||
RLWNM R3, R4, $29, $31, R6 // 5c861f7e
|
||||
RLWNMCC $3, R4, $7, R6 // 54861f7f
|
||||
RLWNMCC $3, R4, $29, $31, R6 // 54861f7f
|
||||
RLWNMCC R3, R4, $7, R6 // 5c861f7f
|
||||
RLWNMCC R3, R4, $29, $31, R6 // 5c861f7f
|
||||
RLDMI $0, R4, $7, R6 // 7886076c
|
||||
RLDMICC $0, R4, $7, R6 // 7886076d
|
||||
RLDIMI $0, R4, $7, R6 // 788601cc
|
||||
|
|
@ -303,6 +320,8 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$0
|
|||
RLDICCC $0, R4, $15, R6 // 788603c9
|
||||
CLRLSLWI $16, R5, $8, R4 // 54a4422e
|
||||
CLRLSLDI $24, R4, $2, R3 // 78831588
|
||||
RLDCR $1, R1, $-16, R1 // 78210ee4
|
||||
RLDCRCC $1, R1, $-16, R1 // 78210ee5
|
||||
|
||||
BEQ 0(PC) // 41820000
|
||||
BEQ CR1,0(PC) // 41860000
|
||||
|
|
|
|||
|
|
@ -280,6 +280,9 @@ start:
|
|||
MOV $2047, X5 // 9b02f07f
|
||||
MOV $-2048, X5 // 9b020080
|
||||
|
||||
// Converted to load of symbol.
|
||||
MOV $4294967296, X5 // 97020000
|
||||
|
||||
MOV (X5), X6 // 03b30200
|
||||
MOV 4(X5), X6 // 03b34200
|
||||
MOVB (X5), X6 // 03830200
|
||||
|
|
@ -325,7 +328,7 @@ start:
|
|||
// These jumps can get printed as jumps to 2 because they go to the
|
||||
// second instruction in the function (the first instruction is an
|
||||
// invisible stack pointer adjustment).
|
||||
JMP start // JMP 2 // 6ff09fc2
|
||||
JMP start // JMP 2 // 6ff01fc2
|
||||
JMP (X5) // 67800200
|
||||
JMP 4(X5) // 67804200
|
||||
|
||||
|
|
@ -338,16 +341,16 @@ start:
|
|||
JMP asmtest(SB) // 970f0000
|
||||
|
||||
// Branch pseudo-instructions
|
||||
BEQZ X5, start // BEQZ X5, 2 // e38602c0
|
||||
BGEZ X5, start // BGEZ X5, 2 // e3d402c0
|
||||
BGT X5, X6, start // BGT X5, X6, 2 // e34253c0
|
||||
BGTU X5, X6, start // BGTU X5, X6, 2 // e36053c0
|
||||
BGTZ X5, start // BGTZ X5, 2 // e34e50be
|
||||
BLE X5, X6, start // BLE X5, X6, 2 // e35c53be
|
||||
BLEU X5, X6, start // BLEU X5, X6, 2 // e37a53be
|
||||
BLEZ X5, start // BLEZ X5, 2 // e35850be
|
||||
BLTZ X5, start // BLTZ X5, 2 // e3c602be
|
||||
BNEZ X5, start // BNEZ X5, 2 // e39402be
|
||||
BEQZ X5, start // BEQZ X5, 2 // e38202c0
|
||||
BGEZ X5, start // BGEZ X5, 2 // e3d002c0
|
||||
BGT X5, X6, start // BGT X5, X6, 2 // e34e53be
|
||||
BGTU X5, X6, start // BGTU X5, X6, 2 // e36c53be
|
||||
BGTZ X5, start // BGTZ X5, 2 // e34a50be
|
||||
BLE X5, X6, start // BLE X5, X6, 2 // e35853be
|
||||
BLEU X5, X6, start // BLEU X5, X6, 2 // e37653be
|
||||
BLEZ X5, start // BLEZ X5, 2 // e35450be
|
||||
BLTZ X5, start // BLTZ X5, 2 // e3c202be
|
||||
BNEZ X5, start // BNEZ X5, 2 // e39002be
|
||||
|
||||
// Set pseudo-instructions
|
||||
SEQZ X15, X15 // 93b71700
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue