3 // Copyright 2012 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 the -X facility of the gc linker (6l etc.).
8 // This test is run by linkx_run.go.
15 var overwrite string = "dibs"
18 var overwritecopy = overwrite
19 var arraycopy = [2]string{tbd, overwrite}
27 fmt.Println(arraycopy[0])
29 fmt.Println(overwrite)
30 fmt.Println(overwritecopy)
31 fmt.Println(arraycopy[1])
33 // Check non-string symbols are not overwritten.
34 // This also make them used.
35 // TODO: decide if we need to issue an error if -X
36 // is applied to a non-string unreachable symbol.
38 panic("b or x overwritten")