summaryrefslogtreecommitdiffstats
path: root/llgo/test/execution/literals/map.go
blob: 32173f50d932da27d0a0e5462b6c904cf01d4a04 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// RUN: llgo -o %t %s
// RUN: %t 2>&1 | FileCheck %s

// CHECK: false
// CHECK-NEXT: 2
// CHECK-NEXT: 1 0 3
// CHECK-NEXT: 0.1
// CHECK-NEXT: 0.2
// CHECK-NEXT: 0.3

package main

func main() {
	type IntMap map[int]int
	m := IntMap{0: 1, 2: 3}
	println(m == nil)
	println(len(m))
	println(m[0], m[1], m[2])

	f32tostr := map[float32]string{0.1: "0.1", 0.2: "0.2", 0.3: "0.3"}
	println(f32tostr[0.1])
	println(f32tostr[0.2])
	println(f32tostr[0.3])
}
OpenPOWER on IntegriCloud