Dan Willemsen | 38f2dba | 2016-07-08 14:54:35 -0700 | [diff] [blame] | 1 | // compile |
| 2 | |
| 3 | // Copyright 2016 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 | |
Dan Willemsen | a322328 | 2018-02-27 19:41:43 -0800 | [diff] [blame] | 7 | // Issue 15747: If an ODCL is dropped, for example when inlining, |
Dan Willemsen | 38f2dba | 2016-07-08 14:54:35 -0700 | [diff] [blame] | 8 | // then it's easy to end up not initializing the '&x' pseudo-variable |
| 9 | // to point to an actual allocation. The liveness analysis will detect |
| 10 | // this and abort the computation, so this test just checks that the |
| 11 | // compilation succeeds. |
| 12 | |
| 13 | package p |
| 14 | |
| 15 | type R [100]byte |
| 16 | |
| 17 | func (x R) New() *R { |
| 18 | return &x |
| 19 | } |