llvm-project/llgo/test/llgoi/maps.test

28 lines
234 B
Plaintext

// RUN: llgoi < %s | FileCheck %s
m := make(map[int]int)
m
// CHECK: map[]
m[0]
// CHECK: 0
m0, ok := m[0]
m0
// CHECK: 0
ok
// CHECK: false
func() {
m[0] = 1
}()
m[0]
// CHECK: 1
m0, ok = m[0]
m0
// CHECK: 1
ok
// CHECK: true