aboutsummaryrefslogtreecommitdiff
path: root/test/codegen
diff options
context:
space:
mode:
Diffstat (limited to 'test/codegen')
-rw-r--r--test/codegen/issue56440.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/codegen/issue56440.go b/test/codegen/issue56440.go
index 36b52ace03..c6c1e66789 100644
--- a/test/codegen/issue56440.go
+++ b/test/codegen/issue56440.go
@@ -16,3 +16,19 @@ func f(x []int) int {
// amd64:`MOVQ\t40\(.*\),`
return x[len(s)]
}
+
+func g(x []int, p *bool) int {
+ s := make([]int, 3)
+ for {
+ s = s[:3]
+ if cap(s) < 5 {
+ s = make([]int, 3, 5)
+ }
+ s = append(s, 4, 5)
+ if *p {
+ // amd64:`MOVQ\t40\(.*\),`
+ return x[len(s)]
+ }
+ }
+ return 0
+}