go/test
amusman c34b99a5e2 cmd/compile: CSE loads across disjoint stores
Enable partitioning together memory user instructions, such as regular
loads, across disjoint memory defining instructions (currently only stores).
Keep a memory table to remember appropriate memory definition for any
supported memory using instruction. This allows to match more load
instructions and potentially may be further improved with handling
additional cases in the common utility `disjoint`.

Generally this change allows to improve code size. For example, here is
code size difference on linux_arm64:

Executable            Old .text  New .text     Change
-------------------------------------------------------
asm                     1963124    1961972     -0.06%
cgo                     1734228    1733140     -0.06%
compile                 8948740    8948516     -0.00%
cover                   1864500    1863588     -0.05%
link                    2555700    2552676     -0.12%
preprofile               863636     862980     -0.08%
vet                     2869220    2867556     -0.06%

Some benchmarks result from a local run:

shortname: aws_jsonutil
pkg: github.com/aws/aws-sdk-go/private/protocol/json/jsonutil
             │ Orig-rand.stdout │          Cse1-rand.stdout          │
             │      sec/op      │   sec/op     vs base               │
BuildJSON-8         1.511µ ± 0%   1.516µ ± 0%  +0.33% (p=0.003 n=15)
StdlibJSON-8        1.254µ ± 0%   1.227µ ± 0%  -2.15% (p=0.000 n=15)
geomean             1.377µ        1.364µ       -0.92%

shortname: kanzi
toolchain: Cse1-rand
goos: linux
goarch: arm64
pkg: github.com/flanglet/kanzi-go/benchmark
        │ Orig-rand.stdout │          Cse1-rand.stdout          │
        │      sec/op      │   sec/op     vs base               │
FPAQ-4         26.11m ± 0%   25.61m ± 0%  -1.93% (p=0.000 n=10)
LZ-4           1.461m ± 1%   1.445m ± 1%       ~ (p=0.105 n=10)
MTFT-4         1.197m ± 0%   1.201m ± 0%  +0.36% (p=0.000 n=10)
geomean        3.574m        3.543m       -0.88%

This change also tends to increase number of NilChecks matched, which
led to moving statement boundary marks from OpNilCheck to its user
instruction (such as OpOffPtr), where it is more likely to be lost
during subsequent optimizations - e.g. see #75249. Because we don't
remove the nil checks in cse, here we also update it to not move
the statement boundary marks from OpNilCheck - the later related
optimizations can handle that better.

Change-Id: Iddf4aa13d44de78ffecf6ccb4c0fd1d35533e844
Reviewed-on: https://go-review.googlesource.com/c/go/+/608115
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
2026-02-05 11:50:32 -08:00
..
abi test: migrate remaining files to go:build syntax 2023-10-19 23:33:25 +00:00
alias3.dir
arenas reflect: fix ArenaNew to match documentation 2023-06-16 17:08:43 +00:00
asmhdr.dir cmd/compile: use exact constant in go_asm.h 2022-01-10 21:27:19 +00:00
chan [dev.typeparams] cmd/compile/internal/types2: implement close(ch) where ch is of type parameter type 2021-07-14 23:33:46 +00:00
closure3.dir cmd/compile: use very high budget for once-called closures 2024-11-22 02:04:41 +00:00
closure5.dir test: use dot-relative imports where appropriate 2022-03-24 02:14:15 +00:00
codegen test/codegen: codify bit related code generation for loong64 2026-02-04 17:02:07 -08:00
ddd2.dir
dwarf
fixedbugs cmd/compile: don't double-walk the map argument of clear 2026-02-04 17:48:06 -08:00
import2.dir
import4.dir go/types, types2: use "and not used" instead of "but not used" in error messages 2022-09-27 21:10:19 +00:00
interface go/types, types2: more systematic use of Checker.use und useLHS 2023-03-28 14:28:33 +00:00
internal/runtime/sys runtime: move getcallersp to internal/runtime/sys 2024-09-17 17:01:20 +00:00
intrinsic.dir runtime,internal: move runtime/internal/sys to internal/runtime/sys 2024-07-23 19:05:35 +00:00
ken runtime: use internal/strconv 2025-10-29 11:00:23 -07:00
linkname.dir test: compile source files as if from "test" module 2022-03-24 17:50:47 +00:00
linknameasm.dir cmd/compile: generate args_stackmap for ABI0 assembly func regardless of linkname 2024-06-07 15:22:22 +00:00
method4.dir
retjmp.dir cmd/internal/obj: fix tail call in non-zero frame leaf function on MIPS and S390X 2021-12-13 22:42:08 +00:00
simd [dev.simd] simd, cmd/compile: move "simd" to "simd/archsimd" 2025-12-08 13:57:44 -08:00
stress test/stress: fix typo in comment 2024-03-25 19:21:35 +00:00
syntax cmd/compile: better error message when offending/missing token is a keyword 2024-11-14 02:14:13 +00:00
typeparam all: fix some minor grammatical issues in the comments 2025-12-30 07:28:53 -08:00
uintptrescapes.dir test: follow got/want convention in uintptrescapes test 2025-12-29 11:21:12 -08:00
wasmmemsize.dir internal/buildcfg: enable greenteagc experiment by default 2025-10-06 16:01:40 -07:00
64bit.go
235.go
alg.go
alias.go
alias1.go
alias2.go go/types, types2: qualify named types in error messages with type kind 2024-10-23 04:43:01 +00:00
alias3.go
align.go
append.go
append1.go cmd/compile: use "cannot use %s as %s value in %s: %s" error message 2022-09-28 22:28:39 +00:00
args.go
armimm.go
asmhdr.go cmd/compile: emit sensible go_asm.h consts for big ints 2021-10-30 18:30:05 +00:00
assign.go sync: add explicit noCopy fields to Map, Mutex, and Once 2024-11-18 18:52:54 +00:00
assign1.go
atomicload.go
bigalg.go
bigmap.go
blank.go
blank1.go
bloop.go cmd/compile: ensure bloop only kept alive addressable nodes 2025-12-02 16:56:58 -08:00
bom.go
bombad.go
bounds.go
cannotassign.go
chancap.go
chanlinear.go test: migrate remaining files to go:build syntax 2023-10-19 23:33:25 +00:00
char_lit.go
char_lit1.go
checkbce.go cmd/compile: make prove understand div, mod better 2025-10-29 18:49:40 -07:00
clear.go cmd/compile: add clear(x) builtin 2023-01-31 19:43:07 +00:00
clearfat.go
closedchan.go
closure.go
closure1.go
closure2.go cmd/compile: experimental loop iterator capture semantics change 2023-03-06 18:34:24 +00:00
closure3.go test: migrate remaining files to go:build syntax 2023-10-19 23:33:25 +00:00
closure4.go
closure5.go
closure6.go
closure7.go
cmp.go
cmp6.go
cmplx.go
cmplxdivide.c
cmplxdivide.go tests: improve consistency and clarity of test diagnostics 2025-12-29 12:17:32 -08:00
cmplxdivide1.go
complit.go
complit1.go go/types, types2: report better error messages for slice expressions 2025-03-11 05:44:15 -07:00
compos.go
const.go
const1.go
const2.go
const3.go
const4.go
const5.go
const6.go
const7.go all: add wasip1 support 2023-04-11 20:56:32 +00:00
const8.go test: add more tests for const decls with ommitted RHS expressions 2022-06-28 18:11:31 +00:00
convert.go
convert1.go
convert2.go go/types, types2: implement slice-to-array conversions 2022-09-08 15:55:44 +00:00
convert3.go
convert4.go cmd/compile: implement slice-to-array conversions 2022-09-19 18:58:26 +00:00
convert5.go cmd/compile: disable use of new saturating float-to-int conversions 2025-10-14 15:09:35 -07:00
convert5.out cmd/compile: modify float-to-[u]int so that amd64 and arm64 match 2025-10-09 08:23:21 -07:00
convinline.go cmd/compile: handle integer conversions in static init inliner 2022-11-17 13:46:05 +00:00
convlit.go cmd/compile/internal/types2: refactor untyped conversions 2021-03-23 05:11:09 +00:00
convlit1.go
convT2X.go
copy.go
copy1.go go/types, types2: better error messages for copy built-in 2025-03-10 21:30:51 -07:00
crlf.go
ddd.go
ddd1.go cmd/compile: use "cannot use %s as %s value in %s: %s" error message 2022-09-28 22:28:39 +00:00
ddd2.go
decl.go
declbad.go cmd/compile: rewrite a, b = f() to use temporaries when type not identical 2021-06-14 07:12:37 +00:00
defer.go
defererrcheck.go test: add open-coded defer tests for too many exits path 2024-07-29 14:30:07 +00:00
deferfin.go
defernil.go
deferprint.go
deferprint.out runtime: use internal/strconv 2025-10-29 11:00:23 -07:00
devirt.go [dev.typeparams] cmd/compile: simplify interface conversions 2021-08-09 16:10:20 +00:00
devirtualization.go cmd/compile/internal/devirtualize: fix OCONVNOP assertion 2025-10-14 09:33:37 -07:00
devirtualization_nil_panics.go cmd/compile/internal/devirtualize: improve concrete type analysis 2025-10-08 14:09:22 -07:00
devirtualization_with_type_assertions_interleaved.go cmd/compile/internal/devirtualize: improve concrete type analysis 2025-10-08 14:09:22 -07:00
directive.go cmd/compile: restrict //go:notinheap to runtime/internal/sys 2022-09-02 06:22:23 +00:00
directive2.go cmd/compile: restrict //go:notinheap to runtime/internal/sys 2022-09-02 06:22:23 +00:00
divide.go
divmod.go
embedfunc.go
embedvers.go
empty.go
env.go test,internal/testdir: don't set GOOS/GOARCH 2023-05-12 12:34:59 +00:00
eof.go
eof1.go
escape.go cmd/compile: experimental loop iterator capture semantics change 2023-03-06 18:34:24 +00:00
escape2.go cmd/compile: allocate backing store for append on the stack 2025-05-19 16:14:53 -07:00
escape2n.go cmd/compile: allocate backing store for append on the stack 2025-05-19 16:14:53 -07:00
escape3.go
escape4.go cmd/compile: retire "IsHiddenClosure" and "IsDeadcodeClosure" 2024-07-22 21:27:37 +00:00
escape5.go cmd/compile/internal/escape: propagate constants to interface conversions to avoid allocs 2025-05-21 12:02:43 -07:00
escape6.go cmd/compile: allow pointer-containing elements in stack allocations 2025-04-04 15:04:34 -07:00
escape_alias.go cmd/compile: introduce alias analysis and automatically free non-aliased memory after growslice 2025-11-26 19:04:05 -08:00
escape_array.go cmd/compile: determine static values of len and cap in make() calls 2025-02-19 13:38:58 -08:00
escape_bloop.go cmd/compile/internal/bloop: avoid extraneous heap allocs in b.Loop body due to autotmp variable scope 2026-01-29 15:51:12 -08:00
escape_calls.go cmd/compile: allocate backing store for append on the stack 2025-05-19 16:14:53 -07:00
escape_closure.go cmd/compile: retire "IsHiddenClosure" and "IsDeadcodeClosure" 2024-07-22 21:27:37 +00:00
escape_field.go
escape_goto.go [dev.typeparams] test: rename blank functions 2021-07-28 21:41:07 +00:00
escape_hash_maphash.go
escape_iface.go cmd/compile/internal/escape: propagate constants to interface conversions to avoid allocs 2025-05-21 12:02:43 -07:00
escape_iface_data.go cmd/compile/internal/walk: use global zeroVal in interface conversions for zero values 2025-05-21 12:24:22 -07:00
escape_indir.go
escape_level.go
escape_make_non_const.go cmd/compile: propagate len([]T{}) to make builtin to allow stack allocation 2025-10-02 11:02:07 -07:00
escape_map.go cmd/compile: allocate backing store for append on the stack 2025-05-19 16:14:53 -07:00
escape_mutations.go cmd/compile: restore zero-copy string->[]byte optimization 2023-08-18 11:58:37 +00:00
escape_param.go [dev.typeparams] cmd/compile: simplify ~r/~b naming 2021-05-26 23:50:32 +00:00
escape_reflect.go reflect: remove calling mapiterkey, mapiterelem 2024-09-18 20:57:20 +00:00
escape_runtime_atomic.go runtime: migrate internal/atomic to internal/runtime 2024-03-25 19:53:03 +00:00
escape_selfassign.go
escape_slice.go cmd/compile: allocate backing store for append on the stack 2025-05-19 16:14:53 -07:00
escape_struct_param1.go
escape_struct_param2.go
escape_struct_return.go [dev.typeparams] cmd/compile: simplify ~r/~b naming 2021-05-26 23:50:32 +00:00
escape_sync_atomic.go
escape_unique.go cmd/compile, unique: model data flow of non-string pointers 2025-05-21 20:07:36 -07:00
escape_unsafe.go test: fix typo in escape_unsafe.go 2022-09-07 17:25:59 +00:00
fibo.go
finprofiled.go test: ignore MemProfileRecords with no live objects in finprofiled.go 2023-11-16 05:48:00 +00:00
float_lit.go
float_lit2.go
float_lit3.go test: re-enable a bunch of tests with types2 2021-12-03 16:24:32 +00:00
floatcmp.go
for.go test: add test cases for index value with range array clear 2023-07-10 16:36:41 +00:00
func.go
func1.go
func2.go
func3.go go/parser, syntax: better error message for parameter missing type 2024-09-30 22:04:40 +00:00
func4.go
func5.go
func6.go
func7.go
func8.go
funcdup.go
funcdup2.go
fuse.go cmd/compile: handle boolean and pointer relations 2024-08-07 16:07:55 +00:00
gc.go
gc1.go
gc2.go test: migrate remaining files to go:build syntax 2023-10-19 23:33:25 +00:00
gcgort.go
gcstring.go
goprint.go
goprint.out runtime: use internal/strconv 2025-10-29 11:00:23 -07:00
goto.go
heapsampling.go test: use lower-case error message in heapsampling.go 2026-01-22 12:57:37 -08:00
helloworld.go
helloworld.out
if.go
import.go
import1.go go/types, types2: use "and not used" instead of "but not used" in error messages 2022-09-27 21:10:19 +00:00
import2.go
import4.go
import5.go
import6.go test: re-enable most go/tests that were disabled because of types2 differences 2022-01-11 02:26:58 +00:00
index.go
index0.go
index1.go
index2.go
indirect.go
indirect1.go
init.go
init1.go
initcomma.go
initexp.go cmd/compile: use "init... cycle" instead of "init... loop" in error messages 2022-09-23 20:27:09 +00:00
initialize.go cmd/compile: handle simple inlined calls in staticinit 2022-11-16 04:04:52 +00:00
initializerr.go test: re-enable most go/tests that were disabled because of types2 differences 2022-01-11 02:26:58 +00:00
initloop.go go/types: improve recursive type error message 2024-10-22 22:20:29 +00:00
inline.go cmd/compile: remove no-longer-necessary recursive inlining checks 2025-03-06 10:07:17 -08:00
inline_big.go cmd/compile: restore zero-copy string->[]byte optimization 2023-08-18 11:58:37 +00:00
inline_caller.go
inline_callers.go
inline_endian.go cmd/compile: allocate backing store for append on the stack 2025-05-19 16:14:53 -07:00
inline_literal.go
inline_math_bits_rotate.go test: migrate remaining files to go:build syntax 2023-10-19 23:33:25 +00:00
inline_sync.go sync: use atomic.Bool for Once.done 2025-04-22 08:28:13 -07:00
inline_variadic.go [dev.typeparams] cmd/compile: simplify inlining variadic calls 2021-05-26 23:50:45 +00:00
int_lit.go
intcvt.go
intrinsic.go test: migrate remaining files to go:build syntax 2023-10-19 23:33:25 +00:00
intrinsic_atomic.go test: migrate remaining files to go:build syntax 2023-10-19 23:33:25 +00:00
iota.go
label.go
label1.go
linkmain.go test: migrate remaining files to go:build syntax 2023-10-19 23:33:25 +00:00
linkmain_run.go test: migrate remaining files to go:build syntax 2023-10-19 23:33:25 +00:00
linkname.go
linkname3.go cmd/compile: disallow linkname referring to instantiations 2024-05-15 19:27:25 +00:00
linknameasm.go cmd/compile: generate args_stackmap for ABI0 assembly func regardless of linkname 2024-06-07 15:22:22 +00:00
linkobj.go test: migrate remaining files to go:build syntax 2023-10-19 23:33:25 +00:00
linkx.go
linkx_run.go test: migrate remaining files to go:build syntax 2023-10-19 23:33:25 +00:00
literal.go
literal2.go
live.go runtime: rename mallocTiny* to mallocgcTinySize* 2026-01-13 09:52:54 -08:00
live1.go
live2.go all: remove GOEXPERIMENT=swissmap 2025-07-30 11:47:14 -07:00
live_regabi.go runtime: rename mallocTiny* to mallocgcTinySize* 2026-01-13 09:52:54 -08:00
live_uintptrkeepalive.go test: migrate remaining files to go:build syntax 2023-10-19 23:33:25 +00:00
loopbce.go cmd/compile: make prove use non-equality in subtraction for a stronger bound 2026-01-29 14:08:19 -08:00
mainsig.go
makechan.go all: fix some comments 2024-04-04 14:29:45 +00:00
makemap.go cmd/compile/internal/types2: add unsafe.Add and unsafe.Slice 2021-04-23 00:41:01 +00:00
makenew.go
makeslice.go
mallocfin.go
map.go tests: improve consistency and clarity of test diagnostics 2025-12-29 12:17:32 -08:00
map1.go
mapclear.go
maplinear.go test: migrate remaining files to go:build syntax 2023-10-19 23:33:25 +00:00
maymorestack.go cmd/{asm,compile,internal/obj}: add "maymorestack" support 2021-11-05 00:52:06 +00:00
mergemul.go
method.go
method1.go cmd/compile: use "method T.m already declared" for method redeclaration errors 2022-09-27 21:59:19 +00:00
method2.go go/types, types2: better error message when using *interface instead of interface 2022-01-10 22:48:40 +00:00
method3.go
method4.go
method5.go
method6.go
method7.go
named.go
named1.go
newexpr.go cmd/compile/internal/staticinit: fix bug in global new(expr) 2026-01-20 13:48:41 -08:00
newinline.go cmd/compile: remove no-longer-necessary recursive inlining checks 2025-03-06 10:07:17 -08:00
nil.go
nilcheck.go [dev.unified] test: tweak nilcheck test 2022-06-30 18:41:59 +00:00
nilptr.go cmd/link: use >4GB base address for 64-bit PE binaries 2025-05-12 11:05:28 -07:00
nilptr2.go
nilptr3.go test: migrate remaining files to go:build syntax 2023-10-19 23:33:25 +00:00
nilptr4.go
nilptr5.go cmd/compile: duplicate nil check to two branches of write barrier 2025-09-19 07:13:32 -07:00
nilptr5_aix.go cmd/compile: duplicate nil check to two branches of write barrier 2025-09-19 07:13:32 -07:00
nilptr5_wasm.go cmd/compile: duplicate nil check to two branches of write barrier 2025-09-19 07:13:32 -07:00
nilptr_aix.go test: migrate remaining files to go:build syntax 2023-10-19 23:33:25 +00:00
noinit.go cmd/compile: reenable inline static init 2023-04-14 17:57:36 +00:00
nosplit.go Revert "cmd/compile: redo arm64 LR/FP save and restore" 2025-10-07 08:21:14 -07:00
nowritebarrier.go cmd/compile: redo IsRuntimePkg/IsReflectPkg predicate 2023-08-22 19:18:21 +00:00
nul1.go
opt_branchlikely.go test: migrate remaining files to go:build syntax 2023-10-19 23:33:25 +00:00
parentype.go
peano.go
phiopt.go cmd/compile: add 2 phiopt cases 2025-05-08 10:18:37 -07:00
print.go
print.out runtime: use internal/strconv 2025-10-29 11:00:23 -07:00
printbig.go
printbig.out
prove.go cmd/compile: CSE loads across disjoint stores 2026-02-05 11:50:32 -08:00
prove_constant_folding.go cmd/compile: rewrite Rsh to RshU if arguments are proved positive 2025-11-21 12:37:30 -08:00
prove_invert_loop_with_unused_iterators.go cmd/compile: make prove understand div, mod better 2025-10-29 18:49:40 -07:00
prove_popcount.go cmd/compile: compute bits.OnesCount's limits from argument's limits 2025-03-11 20:17:36 -07:00
range.go
range2.go internal/goexperiment: delete RangeFunc goexperiment 2025-07-29 12:44:58 -07:00
range3.go cmd/compile: fix typecheck range over rune literal 2023-12-01 17:20:08 +00:00
range4.go internal/goexperiment: delete RangeFunc goexperiment 2025-07-29 12:44:58 -07:00
rangegen.go internal/goexperiment: delete RangeFunc goexperiment 2025-07-29 12:44:58 -07:00
README.md internal/testdir: move to cmd/internal/testdir 2023-05-12 17:18:08 +00:00
recover.go
recover1.go
recover2.go
recover3.go
recover4.go test: migrate remaining files to go:build syntax 2023-10-19 23:33:25 +00:00
recover5.go
reflectmethod1.go
reflectmethod2.go
reflectmethod3.go
reflectmethod4.go
reflectmethod5.go
reflectmethod6.go
reflectmethod7.go all: use reflect.{Pointer,PointerTo} 2021-10-26 14:24:17 +00:00
reflectmethod8.go [dev.typeparams] cmd/compile: fix missing condition in usemethod 2021-07-22 17:48:41 +00:00
rename.go
rename1.go cmd/compile/internal/types2: only mark variables as used if they are 2023-04-19 14:07:00 +00:00
reorder.go
reorder2.go
retjmp.go
return.go
rotate.go
rotate0.go
rotate1.go
rotate2.go
rotate3.go
rune.go
runtime.go
shift1.go test: re-enable a bunch of tests with types2 2021-12-03 16:24:32 +00:00
shift2.go
shift3.go cmd/compile: adjust types2 shift check to match go/types (cleanup) 2022-04-07 17:19:55 +00:00
sieve.go
sigchld.go test: migrate remaining files to go:build syntax 2023-10-19 23:33:25 +00:00
sigchld.out
simassign.go
simd.go [dev.simd] simd, cmd/compile: move "simd" to "simd/archsimd" 2025-12-08 13:57:44 -08:00
simd_inline.go [dev.simd] simd, cmd/compile: move "simd" to "simd/archsimd" 2025-12-08 13:57:44 -08:00
sizeof.go
slice3.go
slice3err.go
slicecap.go
sliceopt.go
solitaire.go
stack.go
stackobj.go
stackobj2.go
stackobj3.go
strcopy.go
strength.go
string_lit.go
stringrange.go test: clarify log message for surrogate UTF-8 check 2025-12-29 11:19:28 -08:00
struct0.go
switch.go [dev.unified] test: add switch test case for tricky nil handling 2022-07-19 23:30:49 +00:00
switch2.go cmd/compile: better error message when offending/missing token is a keyword 2024-11-14 02:14:13 +00:00
switch3.go
switch4.go
switch5.go
switch6.go cmd/compile: use "missing method m" instead of "missing m method" 2022-09-24 17:04:15 +00:00
switch7.go
tailcall.go Revert "cmd/compile: Enable inlining of tail calls" 2025-06-04 08:27:44 -07:00
tighten.go cmd/compile: pair loads and stores on arm64 2025-02-13 14:07:47 -08:00
tinyfin.go
torture.go
turing.go
typecheck.go test: re-enable most go/tests that were disabled because of types2 differences 2022-01-11 02:26:58 +00:00
typecheckloop.go cmd/compile: use "init... cycle" instead of "init... loop" in error messages 2022-09-23 20:27:09 +00:00
typeswitch.go
typeswitch1.go
typeswitch2.go
typeswitch2b.go go/types, types2: use "and not used" instead of "but not used" in error messages 2022-09-27 21:10:19 +00:00
typeswitch3.go cmd/compile/internal/types2: better error for type assertion/switch on type parameter value 2021-11-12 22:20:51 +00:00
uintptrescapes.go
uintptrescapes2.go test: fix tests to work with sizespecializedmalloc turned off 2025-11-13 16:57:31 -08:00
uintptrescapes3.go
uintptrkeepalive.go cmd/compile: add //go:uintptrkeepalive 2022-04-21 18:06:38 +00:00
undef.go
unsafe_slice_data.go cmd/compile: add support for unsafe.{String,StringData,SliceData} 2022-08-31 17:15:15 +00:00
unsafe_string.go cmd/compile: add support for unsafe.{String,StringData,SliceData} 2022-08-31 17:15:15 +00:00
unsafe_string_data.go cmd/compile: add support for unsafe.{String,StringData,SliceData} 2022-08-31 17:15:15 +00:00
unsafebuiltins.go cmd/compile: add support for unsafe.{String,StringData,SliceData} 2022-08-31 17:15:15 +00:00
used.go cmd/compile/internal: support new(expr) 2025-09-23 13:12:12 -07:00
utf.go
varerr.go
varinit.go
wasmexport.go cmd/compile: add basic wasmexport support 2024-08-09 20:07:54 +00:00
wasmexport2.go cmd/compile: allow more types for wasmimport/wasmexport parameters and results 2024-11-11 17:11:50 +00:00
wasmmemsize.go test: add a test for wasm memory usage 2024-10-28 13:27:58 +00:00
weak.go weak: prevent unsafe conversions using weak pointers 2025-02-06 13:16:59 -08:00
winbatch.go
writebarrier.go cmd/compile: don't emit write barriers for offsets of global addresses 2021-08-23 19:46:36 +00:00
zerodivide.go all: use bytes.Cut, strings.Cut 2021-10-06 15:53:04 +00:00
zerosize.go cmd/link: put zero-sized data symbols at same address as runtime.zerobase 2023-04-28 18:35:43 +00:00

The test directory contains tests of the Go tool chain and runtime. It includes black box tests, regression tests, and error output tests. They are run as part of all.bash.

To run just these tests, execute:

../bin/go test cmd/internal/testdir

To run just tests from specified files in this directory, execute:

../bin/go test cmd/internal/testdir -run='Test/(file1.go|file2.go|...)'

Standard library tests should be written as regular Go tests in the appropriate package.

The tool chain and runtime also have regular Go tests in their packages. The main reasons to add a new test to this directory are:

  • it is most naturally expressed using the test runner; or
  • it is also applicable to gccgo and other Go tool chains.