blob: 53301fa81ef4d689b1cf2c82f94fb7690b851c59 [file] [log] [blame]
Rémy Oudompheng2ece2f52012-02-18 22:15:42 +01001// run
Russ Cox7472f4c2009-07-09 12:08:50 -07002
3// Copyright 2009 The Go Authors. All rights reserved.
4// Use of this source code is governed by a BSD-style
5// license that can be found in the LICENSE file.
6
7package main
8
Russ Cox00f9f0c2010-03-30 10:34:57 -07009var g byte = 123
10var f *byte = &g
11var b = make([]byte, 5)
Russ Cox7472f4c2009-07-09 12:08:50 -070012
13func main() {
Russ Cox00f9f0c2010-03-30 10:34:57 -070014 b[0:1][0] = *f
Russ Cox7472f4c2009-07-09 12:08:50 -070015 if b[0] != 123 {
Russ Cox00f9f0c2010-03-30 10:34:57 -070016 println("want 123 got", b[0])
17 panic("fail")
18 }
Russ Cox7472f4c2009-07-09 12:08:50 -070019}