]> Cypherpunks.ru repositories - gostls13.git/blob - test/codegen/writebarrier.go
cmd/compile: allow non-pointer writes in the middle of a write barrier
[gostls13.git] / test / codegen / writebarrier.go
1 // asmcheck
2
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.
6
7 package codegen
8
9 func combine2string(p *[2]string, a, b string) {
10         // amd64:`.*runtime[.]gcWriteBarrier4\(SB\)`
11         // arm64:`.*runtime[.]gcWriteBarrier4\(SB\)`
12         p[0] = a
13         // amd64:-`.*runtime[.]gcWriteBarrier`
14         // arm64:-`.*runtime[.]gcWriteBarrier`
15         p[1] = b
16 }
17
18 func combine4string(p *[4]string, a, b, c, d string) {
19         // amd64:`.*runtime[.]gcWriteBarrier8\(SB\)`
20         // arm64:`.*runtime[.]gcWriteBarrier8\(SB\)`
21         p[0] = a
22         // amd64:-`.*runtime[.]gcWriteBarrier`
23         // arm64:-`.*runtime[.]gcWriteBarrier`
24         p[1] = b
25         // amd64:-`.*runtime[.]gcWriteBarrier`
26         // arm64:-`.*runtime[.]gcWriteBarrier`
27         p[2] = c
28         // amd64:-`.*runtime[.]gcWriteBarrier`
29         // arm64:-`.*runtime[.]gcWriteBarrier`
30         p[3] = d
31 }
32
33 func combine2slice(p *[2][]byte, a, b []byte) {
34         // amd64:`.*runtime[.]gcWriteBarrier4\(SB\)`
35         // arm64:`.*runtime[.]gcWriteBarrier4\(SB\)`
36         p[0] = a
37         // amd64:-`.*runtime[.]gcWriteBarrier`
38         // arm64:-`.*runtime[.]gcWriteBarrier`
39         p[1] = b
40 }
41
42 func combine4slice(p *[4][]byte, a, b, c, d []byte) {
43         // amd64:`.*runtime[.]gcWriteBarrier8\(SB\)`
44         // arm64:`.*runtime[.]gcWriteBarrier8\(SB\)`
45         p[0] = a
46         // amd64:-`.*runtime[.]gcWriteBarrier`
47         // arm64:-`.*runtime[.]gcWriteBarrier`
48         p[1] = b
49         // amd64:-`.*runtime[.]gcWriteBarrier`
50         // arm64:-`.*runtime[.]gcWriteBarrier`
51         p[2] = c
52         // amd64:-`.*runtime[.]gcWriteBarrier`
53         // arm64:-`.*runtime[.]gcWriteBarrier`
54         p[3] = d
55 }