Initial commit: Go 1.23 release state
This commit is contained in:
11
test/fixedbugs/issue42401.dir/a.go
Normal file
11
test/fixedbugs/issue42401.dir/a.go
Normal file
@@ -0,0 +1,11 @@
|
||||
// Copyright 2020 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package a
|
||||
|
||||
var s string
|
||||
|
||||
func init() { s = "a" }
|
||||
|
||||
func Get() string { return s }
|
||||
25
test/fixedbugs/issue42401.dir/b.go
Normal file
25
test/fixedbugs/issue42401.dir/b.go
Normal file
@@ -0,0 +1,25 @@
|
||||
// Copyright 2020 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
_ "unsafe"
|
||||
|
||||
"./a"
|
||||
)
|
||||
|
||||
//go:linkname s test/a.s
|
||||
var s string
|
||||
|
||||
func main() {
|
||||
if a.Get() != "a" {
|
||||
panic("FAIL")
|
||||
}
|
||||
|
||||
s = "b"
|
||||
if a.Get() != "b" {
|
||||
panic("FAIL")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user