X7ROOT File Manager
Current Path:
/opt/golang/1.19.4/test/codegen
opt
/
golang
/
1.19.4
/
test
/
codegen
/
📁
..
📄
README
(5.21 KB)
📄
addrcalc.go
(324 B)
📄
alloc.go
(902 B)
📄
arithmetic.go
(14.63 KB)
📄
bitfield.go
(9.64 KB)
📄
bits.go
(5.95 KB)
📄
bmi.go
(2.19 KB)
📄
bool.go
(705 B)
📄
clobberdead.go
(1.31 KB)
📄
clobberdeadreg.go
(1.29 KB)
📄
compare_and_branch.go
(3.79 KB)
📄
comparisons.go
(11.79 KB)
📄
condmove.go
(5.3 KB)
📄
copy.go
(3.36 KB)
📄
floats.go
(3.21 KB)
📄
fuse.go
(4.79 KB)
📄
issue22703.go
(5.43 KB)
📄
issue25378.go
(445 B)
📄
issue31618.go
(504 B)
📄
issue33580.go
(459 B)
📄
issue38554.go
(355 B)
📄
issue42610.go
(673 B)
📄
issue48054.go
(464 B)
📄
issue52635.go
(655 B)
📄
logic.go
(815 B)
📄
mapaccess.go
(9.21 KB)
📄
maps.go
(3.1 KB)
📄
math.go
(6.12 KB)
📄
mathbits.go
(18.06 KB)
📄
memcombine.go
(24 KB)
📄
memops.go
(11.65 KB)
📄
noextend.go
(4.8 KB)
📄
race.go
(651 B)
📄
regabi_regalloc.go
(494 B)
📄
retpoline.go
(224 B)
📄
rotate.go
(5.43 KB)
📄
select.go
(373 B)
📄
shift.go
(9.15 KB)
📄
shortcircuit.go
(368 B)
📄
slices.go
(8.09 KB)
📄
smallintiface.go
(500 B)
📄
spectre.go
(722 B)
📄
stack.go
(2.96 KB)
📄
strings.go
(2.08 KB)
📄
structs.go
(887 B)
📄
switch.go
(1.13 KB)
📄
zerosize.go
(650 B)
Editing: stack.go
// asmcheck // Copyright 2018 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 codegen import "runtime" // This file contains code generation tests related to the use of the // stack. // Check that stack stores are optimized away. // 386:"TEXT\t.*, [$]0-" // amd64:"TEXT\t.*, [$]0-" // arm:"TEXT\t.*, [$]-4-" // arm64:"TEXT\t.*, [$]0-" // mips:"TEXT\t.*, [$]-4-" // ppc64:"TEXT\t.*, [$]0-" // ppc64le:"TEXT\t.*, [$]0-" // s390x:"TEXT\t.*, [$]0-" func StackStore() int { var x int return *(&x) } type T struct { A, B, C, D int // keep exported fields x, y, z int // reset unexported fields } // Check that large structs are cleared directly (issue #24416). // 386:"TEXT\t.*, [$]0-" // amd64:"TEXT\t.*, [$]0-" // arm:"TEXT\t.*, [$]0-" (spills return address) // arm64:"TEXT\t.*, [$]0-" // mips:"TEXT\t.*, [$]-4-" // ppc64:"TEXT\t.*, [$]0-" // ppc64le:"TEXT\t.*, [$]0-" // s390x:"TEXT\t.*, [$]0-" func ZeroLargeStruct(x *T) { t := T{} *x = t } // Check that structs are partially initialised directly (issue #24386). // Notes: // - 386 fails due to spilling a register // amd64:"TEXT\t.*, [$]0-" // arm:"TEXT\t.*, [$]0-" (spills return address) // arm64:"TEXT\t.*, [$]0-" // ppc64:"TEXT\t.*, [$]0-" // ppc64le:"TEXT\t.*, [$]0-" // s390x:"TEXT\t.*, [$]0-" // Note: that 386 currently has to spill a register. func KeepWanted(t *T) { *t = T{A: t.A, B: t.B, C: t.C, D: t.D} } // Check that small array operations avoid using the stack (issue #15925). // Notes: // - 386 fails due to spilling a register // - arm & mips fail due to softfloat calls // amd64:"TEXT\t.*, [$]0-" // arm64:"TEXT\t.*, [$]0-" // ppc64:"TEXT\t.*, [$]0-" // ppc64le:"TEXT\t.*, [$]0-" // s390x:"TEXT\t.*, [$]0-" func ArrayAdd64(a, b [4]float64) [4]float64 { return [4]float64{a[0] + b[0], a[1] + b[1], a[2] + b[2], a[3] + b[3]} } // Check that small array initialization avoids using the stack. // 386:"TEXT\t.*, [$]0-" // amd64:"TEXT\t.*, [$]0-" // arm:"TEXT\t.*, [$]0-" (spills return address) // arm64:"TEXT\t.*, [$]0-" // mips:"TEXT\t.*, [$]-4-" // ppc64:"TEXT\t.*, [$]0-" // ppc64le:"TEXT\t.*, [$]0-" // s390x:"TEXT\t.*, [$]0-" func ArrayInit(i, j int) [4]int { return [4]int{i, 0, j, 0} } // Check that assembly output has matching offset and base register // (issue #21064). func check_asmout(b [2]int) int { runtime.GC() // use some frame // amd64:`.*b\+24\(SP\)` // arm:`.*b\+4\(FP\)` return b[1] } // Check that simple functions get promoted to nosplit, even when // they might panic in various ways. See issue 31219. // amd64:"TEXT\t.*NOSPLIT.*" func MightPanic(a []int, i, j, k, s int) { _ = a[i] // panicIndex _ = a[i:j] // panicSlice _ = a[i:j:k] // also panicSlice _ = i << s // panicShift _ = i / j // panicDivide } // Put a defer in a loop, so second defer is not open-coded func Defer() { for i := 0; i < 2; i++ { defer func() {}() } // amd64:`CALL\truntime\.deferprocStack` defer func() {}() }
Upload File
Create Folder