1
0
mirror of https://github.com/golang/go synced 2024-09-23 21:20:13 -06:00
go/test
Cherry Zhang a444458112 cmd/compile: make sure linkname'd symbol is non-package
When a variable symbol is both imported (possibly through
inlining) and linkname'd, make sure its LSym is marked as
non-package for symbol indexing in the object file, so it is
resolved by name and dedup'd with the original definition.

Fixes #42401.

Change-Id: I8e90c0418c6f46a048945c5fdc06c022b77ed68d
Reviewed-on: https://go-review.googlesource.com/c/go/+/268178
Trust: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
2020-11-09 16:09:16 +00:00
..
alias3.dir
bench
chan test/chan: fix trivial typos 2020-03-25 22:22:20 +00:00
closure3.dir cmd/compile: allow inlining of "for" loops 2020-10-15 18:26:33 +00:00
codegen test/codegen: go fmt 2020-11-08 12:19:55 +00:00
ddd2.dir
dwarf
fixedbugs cmd/compile: make sure linkname'd symbol is non-package 2020-11-09 16:09:16 +00:00
import2.dir
import4.dir
interface
intrinsic.dir
ken
linkname.dir
method4.dir
oldescape_linkname.dir
retjmp.dir
runtime
stress
syntax cmd/compile/internal/syntax: better error when an assignment is used in value context 2020-02-21 22:57:52 +00:00
uintptrescapes.dir
64bit.go
235.go
alg.go
alias1.go
alias2.go cmd/compile: use clearer error message for stuct literal 2020-09-12 08:31:49 +00:00
alias3.go
alias.go
align.go
append1.go
append.go
args.go
armimm.go
assign1.go
assign.go
atomicload.go
bigalg.go
bigmap.go
blank1.go test, test/fixedbugs, crypto/x509, go/internal/gccgoimporter: fix typos 2020-03-29 17:12:56 +00:00
blank.go
bom.go
bombad.go
bounds.go cmd/compile: defer lowering OANDNOT until SSA 2020-10-27 03:11:45 +00:00
cannotassign.go cmd/compile: be more specific in cannot assign errors 2020-09-16 20:04:58 +00:00
chancap.go
chanlinear.go test, test/fixedbugs, crypto/x509, go/internal/gccgoimporter: fix typos 2020-03-29 17:12:56 +00:00
char_lit1.go
char_lit.go
checkbce.go
clearfat.go
closedchan.go
closure1.go
closure2.go
closure3.go
closure4.go
closure.go
cmp6.go
cmp.go
cmplx.go
cmplxdivide1.go
cmplxdivide.c
cmplxdivide.go
complit1.go
complit.go
compos.go
const1.go
const2.go
const3.go
const4.go
const5.go
const6.go
const.go
convert1.go
convert2.go
convert3.go
convert.go
convlit1.go
convlit.go
convT2X.go
copy1.go
copy.go
crlf.go
ddd1.go cmd/compile: don't report not enough args error if call is undefined 2020-09-12 08:50:45 +00:00
ddd2.go
ddd.go
decl.go
declbad.go
defer.go
defererrcheck.go test: re-enable open-coded defer test on riscv64 2020-02-26 16:54:17 +00:00
deferfin.go
defernil.go
deferprint.go
deferprint.out
devirt.go cmd/compile: debug rewrite 2020-04-13 21:56:15 +00:00
directive.go cmd/compile: reject misplaced go:build comments 2020-10-13 01:16:45 +00:00
divide.go
divmod.go
empty.go
env.go
eof1.go
eof.go
escape2.go cmd/compile: use clearer error message for stuct literal 2020-09-12 08:31:49 +00:00
escape2n.go cmd/compile: use clearer error message for stuct literal 2020-09-12 08:31:49 +00:00
escape3.go
escape4.go
escape5.go cmd/compile: add failing test case for #24305 2020-08-15 03:09:52 +00:00
escape_array.go
escape_calls.go cmd/compile: use clearer error message for stuct literal 2020-09-12 08:31:49 +00:00
escape_closure.go cmd/compile: improve escape analysis of known calls 2020-10-15 18:26:06 +00:00
escape_field.go cmd/compile: use clearer error message for stuct literal 2020-09-12 08:31:49 +00:00
escape_goto.go
escape_hash_maphash.go
escape_iface.go cmd/compile: fix devirtualization of promoted interface methods 2020-10-30 00:47:37 +00:00
escape_indir.go cmd/compile: use clearer error message for stuct literal 2020-09-12 08:31:49 +00:00
escape_level.go
escape_map.go cmd/compile: use clearer error message for stuct literal 2020-09-12 08:31:49 +00:00
escape_param.go cmd/compile: use clearer error message for stuct literal 2020-09-12 08:31:49 +00:00
escape_runtime_atomic.go
escape_selfassign.go
escape_slice.go cmd/compile: use clearer error message for stuct literal 2020-09-12 08:31:49 +00:00
escape_struct_param1.go cmd/compile: use clearer error message for stuct literal 2020-09-12 08:31:49 +00:00
escape_struct_param2.go cmd/compile: use clearer error message for stuct literal 2020-09-12 08:31:49 +00:00
escape_struct_return.go
escape_sync_atomic.go
escape_unsafe.go
escape.go
fibo.go
finprofiled.go
float_lit2.go
float_lit3.go
float_lit.go
floatcmp.go
for.go
func1.go
func2.go
func3.go
func4.go
func5.go
func6.go
func7.go
func8.go
func.go
funcdup2.go
funcdup.go
gc1.go
gc2.go
gc.go
gcgort.go
gcstring.go
goprint.go
goprint.out
goto.go
heapsampling.go
helloworld.go
helloworld.out
if.go
import1.go
import2.go
import4.go
import5.go
import6.go
import.go
index0.go
index1.go
index2.go
index.go
indirect1.go
indirect.go
init1.go
init.go
initcomma.go
initempty.go
initialize.go
initializerr.go
initloop.go
inline_big.go cmd/compile: output cost while inlining function with Debug['m'] > 1 2020-02-26 14:44:24 +00:00
inline_caller.go
inline_callers.go
inline_literal.go
inline_math_bits_rotate.go
inline_sync.go test: re-enable atomic intrinsic related tests on riscv64 2020-03-25 01:11:15 +00:00
inline_variadic.go cmd/compile: use clearer error message for stuct literal 2020-09-12 08:31:49 +00:00
inline.go cmd/compile: support inlining of type switches 2020-11-06 20:49:11 +00:00
int_lit.go
intcvt.go
intrinsic_atomic.go test: re-enable atomic intrinsic related tests on riscv64 2020-03-25 01:11:15 +00:00
intrinsic.go
iota.go
label1.go
label.go
linkmain_run.go
linkmain.go
linkname.go
linkobj.go
linkx_run.go
linkx.go
literal2.go
literal.go
live1.go
live2.go
live_syscall.go
live.go cmd/compile,cmd/link: fix and re-enable open-coded defers on riscv64 2020-01-29 16:34:44 +00:00
locklinear.go
loopbce.go
makechan.go test: remove duplicate code from makechan/makemap 2020-04-19 07:51:23 +00:00
makemap.go test: remove duplicate code from makechan/makemap 2020-04-19 07:51:23 +00:00
makenew.go
makeslice.go cmd/compile: optimize make+copy pattern to avoid memclr 2020-05-07 17:50:24 +00:00
mallocfin.go
map1.go
map.go
mapclear.go
maplinear.go
mergemul.go
method1.go
method2.go
method3.go
method4.go
method5.go
method6.go
method7.go
method.go
named1.go
named.go
nil.go
nilcheck.go
nilptr2.go
nilptr3.go
nilptr4.go
nilptr5_aix.go
nilptr5_wasm.go
nilptr5.go
nilptr_aix.go
nilptr.go cmd/dist: enable more tests on macOS/ARM64 2020-10-06 21:55:49 +00:00
nosplit.go runtime: static lock ranking for the runtime (enabled by GOEXPERIMENT) 2020-04-07 21:51:03 +00:00
notinheap2.go cmd/compile: propagate go:notinheap implicitly 2020-09-17 19:35:53 +00:00
notinheap3.go
notinheap.go cmd/compile: propagate go:notinheap implicitly 2020-09-17 19:35:53 +00:00
nowritebarrier.go cmd/compile: allow mid-stack inlining when there is a cycle of recursion 2020-04-03 21:43:52 +00:00
nul1.go
opt_branchlikely.go
parentype.go
peano.go
phiopt.go
print.go
print.out
printbig.go
printbig.out
prove.go cmd/compile: check indirect connection between if block and phi block in addLocalInductiveFacts 2020-11-07 07:33:23 +00:00
range.go
README.md test: document specifying individual test files as operands 2020-08-28 21:23:32 +00:00
recover1.go
recover2.go
recover3.go
recover4.go
recover5.go
recover.go
reflectmethod1.go
reflectmethod2.go
reflectmethod3.go
reflectmethod4.go
reflectmethod5.go cmd/compile: when marking REFLECTMETHOD, check for reflect package itself 2020-04-19 03:12:32 +00:00
reflectmethod6.go cmd/compile: when marking REFLECTMETHOD, check for reflect package itself 2020-04-19 03:12:32 +00:00
rename1.go
rename.go
reorder2.go
reorder.go
retjmp.go
return.go
rotate0.go
rotate1.go
rotate2.go
rotate3.go
rotate.go
run.go all: implement GO386=softfloat 2020-10-06 22:49:38 +00:00
rune.go
runtime.go cmd/compile: report error for unexported name only once 2020-08-25 16:06:36 +00:00
shift1.go
shift2.go
sieve.go
sigchld.go
sigchld.out
simassign.go
sinit_run.go
sinit.go
sizeof.go
slice3.go
slice3err.go
slicecap.go
sliceopt.go
solitaire.go
stack.go
stackobj2.go
stackobj3.go
stackobj.go
strcopy.go
strength.go
string_lit.go
stringrange.go
struct0.go
switch2.go
switch3.go
switch4.go
switch5.go
switch6.go
switch7.go
switch.go
tinyfin.go
torture.go
turing.go
typecheck.go test: add copyright notice to typecheck.go 2020-04-17 13:30:49 +00:00
typecheckloop.go
typeswitch1.go
typeswitch2.go
typeswitch2b.go
typeswitch3.go
typeswitch.go
uintptrescapes2.go
uintptrescapes3.go
uintptrescapes.go
undef.go
utf.go
varerr.go
varinit.go
winbatch.go all: treat all files as binary, but check in .bat with CRLF 2020-06-08 15:31:43 +00:00
writebarrier.go cmd/compile: improve generated code for concrete cases in type switches 2020-04-14 17:34:31 +00:00
zerodivide.go

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 run run.go

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

../bin/go run run.go -- 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.