Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/compile: new codegen test harness too verbose in case of failure #24216

Closed
ALTree opened this issue Mar 2, 2018 · 1 comment
Closed

cmd/compile: new codegen test harness too verbose in case of failure #24216

ALTree opened this issue Mar 2, 2018 · 1 comment

Comments

@ALTree
Copy link
Member

ALTree commented Mar 2, 2018

(I know it's not finished, but recording here since I'm poking at it).

The new code generation harness introduced in CL 97355 (and refined in subsequent CL) is more verbose than the current one in case of failures. The main issue is that the whole disasm output is dumped to file. Take the following test (func f is supposed to fail):

// asmcheck

package codegen

func f(x float64) float64 {
	// amd64:"NOPE"
	return x + 1
}

func g(x float64) float64 {
	// amd64:"ADD"
	return x + 2
}

func h(x float64) float64 {
	// amd64:"ADD"
	return x + 3
}

The FAIL message dumps the whole file's disasm to std, including

  1. the disassembly of all the functions in the file, including g and h, where we don't have any failure
  2. a long tail of dwarf info and friends. (small sample):
go.info."".f SDWARFINFO size=55
	0x0000 02 22 22 2e 66 00 00 00 00 00 00 00 00 00 00 00  ."".f...........
	0x0010 00 00 00 00 00 00 01 9c 00 00 00 00 01 0e 78 00  ..............x.
	0x0020 00 05 00 00 00 00 01 9c 0e 7e 72 31 00 01 05 00  .........~r1....
	0x0030 00 00 00 02 91 08 00                             .......
	rel 6+8 t=1 "".f+0
	rel 14+8 t=1 "".f+25
	rel 24+4 t=29 gofile../home/alberto/go/test/codegen/intrinsics.go+0
	rel 34+4 t=28 go.info.float64+0
	rel 47+4 t=28 go.info.float64+0

The current test harness only prints the disasm of the function included in the failing check, making the failure message much more easier to read.

@ALTree
Copy link
Member Author

ALTree commented Mar 5, 2018

Fixed in http://golang.org/cl/98444

@ALTree ALTree closed this as completed Mar 5, 2018
@golang golang locked and limited conversation to collaborators Mar 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants