github.com/go-asm/go@v1.21.1-0.20240213172139-40c5ead50c48/cmd/compile/ssa/testdata/hist.dlv-opt.nexts (about)

     1    ./testdata/hist.go
     2  55:	func test() {
     3  57:		l := line{point{1 + zero, 2 + zero}, point{3 + zero, 4 + zero}}
     4  58:		tinycall()                // this forces l etc to stack
     5  59:		dx := l.end.x - l.begin.x //gdb-dbg=(l.begin.x,l.end.y)//gdb-opt=(l,dx/O,dy/O)
     6  60:		dy := l.end.y - l.begin.y //gdb-opt=(dx,dy/O)
     7  61:		sink = dx + dy            //gdb-opt=(dx,dy)
     8  63:		hist := make([]int, 7)                                //gdb-opt=(dx/O,dy/O) // TODO sink is missing if this code is in 'test' instead of 'main'
     9  64:		var reader io.Reader = strings.NewReader(cannedInput) //gdb-dbg=(hist/A) // TODO cannedInput/A is missing if this code is in 'test' instead of 'main'
    10  65:		if len(os.Args) > 1 {
    11  73:		scanner := bufio.NewScanner(reader)
    12  74:		for scanner.Scan() { //gdb-opt=(scanner/A)
    13  75:			s := scanner.Text()
    14  76:			i, err := strconv.ParseInt(s, 10, 64)
    15  77:			if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
    16  81:			hist = ensure(int(i), hist)
    17  82:			hist[int(i)]++
    18  74:		for scanner.Scan() { //gdb-opt=(scanner/A)
    19  75:			s := scanner.Text()
    20  76:			i, err := strconv.ParseInt(s, 10, 64)
    21  77:			if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
    22  81:			hist = ensure(int(i), hist)
    23  82:			hist[int(i)]++
    24  74:		for scanner.Scan() { //gdb-opt=(scanner/A)
    25  75:			s := scanner.Text()
    26  76:			i, err := strconv.ParseInt(s, 10, 64)
    27  77:			if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
    28  81:			hist = ensure(int(i), hist)
    29  82:			hist[int(i)]++
    30  74:		for scanner.Scan() { //gdb-opt=(scanner/A)
    31  75:			s := scanner.Text()
    32  76:			i, err := strconv.ParseInt(s, 10, 64)
    33  77:			if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
    34  81:			hist = ensure(int(i), hist)
    35  82:			hist[int(i)]++
    36  74:		for scanner.Scan() { //gdb-opt=(scanner/A)
    37  75:			s := scanner.Text()
    38  76:			i, err := strconv.ParseInt(s, 10, 64)
    39  77:			if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
    40  81:			hist = ensure(int(i), hist)
    41  82:			hist[int(i)]++
    42  74:		for scanner.Scan() { //gdb-opt=(scanner/A)
    43  75:			s := scanner.Text()
    44  76:			i, err := strconv.ParseInt(s, 10, 64)
    45  77:			if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
    46  81:			hist = ensure(int(i), hist)
    47  82:			hist[int(i)]++
    48  74:		for scanner.Scan() { //gdb-opt=(scanner/A)
    49  75:			s := scanner.Text()
    50  76:			i, err := strconv.ParseInt(s, 10, 64)
    51  77:			if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
    52  81:			hist = ensure(int(i), hist)
    53  82:			hist[int(i)]++
    54  74:		for scanner.Scan() { //gdb-opt=(scanner/A)
    55  75:			s := scanner.Text()
    56  76:			i, err := strconv.ParseInt(s, 10, 64)
    57  77:			if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
    58  81:			hist = ensure(int(i), hist)
    59  82:			hist[int(i)]++
    60  74:		for scanner.Scan() { //gdb-opt=(scanner/A)
    61  75:			s := scanner.Text()
    62  76:			i, err := strconv.ParseInt(s, 10, 64)
    63  77:			if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
    64  81:			hist = ensure(int(i), hist)
    65  82:			hist[int(i)]++
    66  74:		for scanner.Scan() { //gdb-opt=(scanner/A)
    67  86:		for i, a := range hist {
    68  87:			if a == 0 { //gdb-opt=(a,n,t)
    69  86:		for i, a := range hist {
    70  87:			if a == 0 { //gdb-opt=(a,n,t)
    71  92:			fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
    72  91:			n += a
    73  90:			t += i * a
    74  86:		for i, a := range hist {
    75  87:			if a == 0 { //gdb-opt=(a,n,t)
    76  92:			fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
    77  91:			n += a
    78  90:			t += i * a
    79  86:		for i, a := range hist {
    80  87:			if a == 0 { //gdb-opt=(a,n,t)
    81  86:		for i, a := range hist {
    82  87:			if a == 0 { //gdb-opt=(a,n,t)
    83  92:			fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
    84  91:			n += a
    85  90:			t += i * a
    86  86:		for i, a := range hist {
    87  87:			if a == 0 { //gdb-opt=(a,n,t)
    88  92:			fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
    89  91:			n += a
    90  90:			t += i * a
    91  86:		for i, a := range hist {
    92  87:			if a == 0 { //gdb-opt=(a,n,t)
    93  86:		for i, a := range hist {
    94  99:	}