summaryrefslogtreecommitdiff
path: root/test/codegen/maps.go
diff options
context:
space:
mode:
Diffstat (limited to 'test/codegen/maps.go')
-rw-r--r--test/codegen/maps.go30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/codegen/maps.go b/test/codegen/maps.go
index dcb4a9381f..ea3a70d1f0 100644
--- a/test/codegen/maps.go
+++ b/test/codegen/maps.go
@@ -122,3 +122,33 @@ func MapClearSideEffect(m map[int]int) int {
}
return k
}
+
+func MapLiteralSizing(x int) (map[int]int, map[int]int) {
+ // amd64:"MOVL\t[$]10,"
+ m := map[int]int{
+ 0: 0,
+ 1: 1,
+ 2: 2,
+ 3: 3,
+ 4: 4,
+ 5: 5,
+ 6: 6,
+ 7: 7,
+ 8: 8,
+ 9: 9,
+ }
+ // amd64:"MOVL\t[$]10,"
+ n := map[int]int{
+ 0: x,
+ 1: x,
+ 2: x,
+ 3: x,
+ 4: x,
+ 5: x,
+ 6: x,
+ 7: x,
+ 8: x,
+ 9: x,
+ }
+ return m, n
+}