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.
7 // Test go:nowritebarrier and related directives.
20 x.f = y // ERROR "write barrier prohibited"
29 //go:nowritebarrierrec
36 x.f = y // ERROR "write barrier prohibited by caller"
39 // Test recursive cycles through nowritebarrierrec and yeswritebarrierrec.
41 //go:nowritebarrierrec
46 //go:yeswritebarrierrec
56 //go:nowritebarrierrec
61 //go:nowritebarrierrec
72 x.f = y // ERROR "write barrier prohibited by caller"
76 //go:yeswritebarrierrec
82 func systemstack(func()) {}
84 //go:nowritebarrierrec
88 x.f = y // ERROR "write barrier prohibited by caller"
93 x.f = y // ERROR "write barrier prohibited by caller"