Debian Codegraph @

gcc/testsuite/go.test/test/fixedbugs/issue42032.go

raw
1 // run
2
3 // Copyright 2020 The Go Authors. All rights reserved. Use of this
4 // source code is governed by a BSD-style license that can be found in
5 // the LICENSE file.
6
7 package main
8
9 //go:notinheap
10 type NIH struct {
11 }
12
13 type T struct {
14 x *NIH
15 p *int
16 }
17
18 var y NIH
19 var z int
20
21 func main() {
22 a := []T{{&y, &z}}
23 a = append(a, T{&y, &z})
24 if a[1].x == nil {
25 panic("pointer not written")
26 }
27 }