Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(7)

Side by Side Diff: test/torture.go

Issue 6733055: code review 6733055: cmd/5g, cmd/6g: fix out of registers with array indexing. (Closed)
Patch Set: diff -r 4f5ad3a5b26d https://go.googlecode.com/hg/ Created 12 years, 5 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/cmd/gc/fmt.c ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // compile 1 // compile
2 2
3 // Copyright 2012 The Go Authors. All rights reserved. 3 // Copyright 2012 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style 4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file. 5 // license that can be found in the LICENSE file.
6 6
7 // Various tests for expressions with high complexity. 7 // Various tests for expressions with high complexity.
8 8
9 package main 9 package main
10 10
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 m[0][2]*m[1][3]*m[2][0]*m[3][1] - 109 m[0][2]*m[1][3]*m[2][0]*m[3][1] -
110 m[0][2]*m[1][3]*m[2][1]*m[3][0] - 110 m[0][2]*m[1][3]*m[2][1]*m[3][0] -
111 m[0][3]*m[1][0]*m[2][1]*m[3][2] + 111 m[0][3]*m[1][0]*m[2][1]*m[3][2] +
112 m[0][3]*m[1][0]*m[2][2]*m[3][1] + 112 m[0][3]*m[1][0]*m[2][2]*m[3][1] +
113 m[0][3]*m[1][1]*m[2][0]*m[3][2] - 113 m[0][3]*m[1][1]*m[2][0]*m[3][2] -
114 m[0][3]*m[1][1]*m[2][2]*m[3][0] - 114 m[0][3]*m[1][1]*m[2][2]*m[3][0] -
115 m[0][3]*m[1][2]*m[2][0]*m[3][1] + 115 m[0][3]*m[1][2]*m[2][0]*m[3][1] +
116 m[0][3]*m[1][2]*m[2][1]*m[3][0] 116 m[0][3]*m[1][2]*m[2][1]*m[3][0]
117 } 117 }
118 118
119 type A []A
120
121 // A sequence of constant indexings.
122 func IndexChain1(s A) A {
123 return s[0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0]
124 }
125
126 // A sequence of non-constant indexings.
127 func IndexChain2(s A, i int) A {
128 return s[i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i]
129 }
130
131 // Another sequence of indexings.
132 func IndexChain3(s []int) int {
133 return s[s[s[s[s[s[s[s[s[s[s[s[s[s[s[s[s[s[s[s[s[0]]]]]]]]]]]]]]]]]]]]]
134 }
135
119 // A right-leaning tree of byte multiplications. 136 // A right-leaning tree of byte multiplications.
120 func righttree(a, b, c, d uint8) uint8 { 137 func righttree(a, b, c, d uint8) uint8 {
121 return a * (b * (c * (d * 138 return a * (b * (c * (d *
122 (a * (b * (c * (d * 139 (a * (b * (c * (d *
123 (a * (b * (c * (d * 140 (a * (b * (c * (d *
124 (a * (b * (c * (d * 141 (a * (b * (c * (d *
125 (a * (b * (c * (d * 142 (a * (b * (c * (d *
126 a * (b * (c * d))))))))))))))))) )))) 143 a * (b * (c * d))))))))))))))))) ))))
127 144
128 } 145 }
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 (a / (b / (a / (b / 327 (a / (b / (a / (b /
311 (a / (b / (a / (b / 328 (a / (b / (a / (b /
312 (a / (b / (a / b)))))))))))))))))) 329 (a / (b / (a / b))))))))))))))))))
313 } 330 }
314 331
315 func ChainDivConst(a int) int { 332 func ChainDivConst(a int) int {
316 return a / 17 / 17 / 17 / 333 return a / 17 / 17 / 17 /
317 17 / 17 / 17 / 17 / 334 17 / 17 / 17 / 17 /
318 17 / 17 / 17 / 17 335 17 / 17 / 17 / 17
319 } 336 }
OLDNEW
« no previous file with comments | « src/cmd/gc/fmt.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b