Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/compile: add line number test for #49436
This enhances the existing line number test to allow a specific -gcflags (e.g., -G=3) and to permit ignoring duplicate line numbers (which is arguably a bug, but not THIS bug, and it lowers the risk of a flaky test). Limited to Linux/Darwin and amd64/arm64, also tests with "unified" mangling. And, using these new powers, adds a test. Updates #49436. Change-Id: I09c82e6a08d53edd5a752522a827e872d3e16e0b Reviewed-on: https://go-review.googlesource.com/c/go/+/362714 Trust: David Chase <drchase@google.com> Run-TryBot: David Chase <drchase@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
- Loading branch information
Showing
2 changed files
with
70 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package main | ||
|
||
type Node struct { | ||
Circular bool | ||
} | ||
|
||
type ExtNode[V any] struct { | ||
v V | ||
Node | ||
} | ||
|
||
type List[V any] struct { | ||
root *ExtNode[V] | ||
len int | ||
} | ||
|
||
func (list *List[V]) PushBack(arg V) { | ||
if list.len == 0 { | ||
list.root = &ExtNode[V]{v: arg} | ||
list.root.Circular = true | ||
list.len++ | ||
return | ||
} | ||
list.len++ | ||
} | ||
|
||
func main() { | ||
var v List[int] | ||
v.PushBack(1) | ||
} |