Source file test/codegen/deadstore.go
1 // asmcheck 2 3 // Copyright 2026 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 type S struct { 10 a, b, c, d, e int 11 } 12 13 func f1(s *S) { 14 // amd64:-`MOVUPS X15` 15 // arm64:`FSTPQ` -`STP \(ZR, ZR\)` -`MOVD ZR` 16 *s = S{} 17 // arm64:`MOVD \$7` `MOVD R[0-9]+, 32\(R[0-9]+\)` 18 *s = S{a: 3, b: 4, c: 5, d: 6, e: 7} 19 } 20 21 func f2(s *S) { 22 // amd64:`MOVQ \$3` 23 // arm64:-`FSTPQ` 24 *s = S{a: 1, b: 2, c: 3, d: 4, e: 5} 25 // amd64:-`MOVQ` 26 s.a = 3 27 // amd64:`MOVQ \$4` 28 s.b = 4 29 // amd64:`MOVQ \$5` 30 s.c = 5 31 // amd64:`MOVQ \$6` 32 s.d = 6 33 // amd64:`MOVQ \$7` 34 s.e = 7 35 } 36