3 // Copyright 2023 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.
7 // Test that zero-sized variables get same address as
13 var p, q = new([0]int), new([0]int) // should get &runtime.zerobase
17 // Failing for now. x and y are at same address, but compiler optimizes &x==&y to false. Skip.
18 // print("&x=", &x, " &y=", &y, " &x==&y = ", &x==&y, "\n")
22 print("p=", p, " q=", q, " p==q = ", p==q, "\n")
26 print("&x=", &x, " p=", p, " &x==p = ", &x==p, "\n")
30 print("&y=", &y, " p=", p, " &y==p = ", &y==p, "\n")