go/src/runtime/stack_test.go

// TestStackMem measures per-thread stack segment cache behavior.
// The test consumed up to 500MB in the past.
func TestStackMem(t *testing.T) {}

// Test stack growing in different contexts.
func TestStackGrowth(t *testing.T) {}

func growStack(progress *atomic.Uint32) {}

// This function is not an anonymous func, so that the compiler can do escape
// analysis and place x on stack (and subsequently stack growth update the pointer).
func growStackIter(p *int, n int) {}

func TestStackGrowthCallback(t *testing.T) {}

func growStackWithCallback(cb func()) {}

// TestDeferPtrs tests the adjustment of Defer's argument pointers (p aka &y)
// during a stack copy.
func set(p *int, x int) {}

func TestDeferPtrs(t *testing.T) {}

type bigBuf

// TestDeferPtrsGoexit is like TestDeferPtrs but exercises the possibility that the
// stack grows as part of starting the deferred function. It calls Goexit at various
// stack depths, forcing the deferred function (with >4kB of args) to be run at
// the bottom of the stack. The goal is to find a stack depth less than 4kB from
// the end of the stack. Each trial runs in a different goroutine so that an earlier
// stack growth does not invalidate a later attempt.
func TestDeferPtrsGoexit(t *testing.T) {}

func testDeferPtrsGoexit(c chan int, i int) {}

func setBig(p *int, x int, b bigBuf) {}

// TestDeferPtrsPanic is like TestDeferPtrsGoexit, but it's using panic instead
// of Goexit to run the Defers. Those two are different execution paths
// in the runtime.
func TestDeferPtrsPanic(t *testing.T) {}

func testDeferPtrsPanic(c chan int, i int) {}

//go:noinline
func testDeferLeafSigpanic1() {}

// TestDeferLeafSigpanic tests defer matching around leaf functions
// that sigpanic. This is tricky because on LR machines the outer
// function and the inner function have the same SP, but it's critical
// that we match up the defer correctly to get the right liveness map.
// See issue #25499.
func TestDeferLeafSigpanic(t *testing.T) {}

// TestPanicUseStack checks that a chain of Panic structs on the stack are
// updated correctly if the stack grows during the deferred execution that
// happens as a result of the panic.
func TestPanicUseStack(t *testing.T) {}

func TestPanicFar(t *testing.T) {}

type xtreeNode

func makeTree(d int) *xtreeNode {}

// use about n KB of stack and call f
func useStackAndCall(n int, f func()) {}

func useStack(n int) {}

func growing(c chan int, done chan struct{}

func TestStackCache(t *testing.T) {}

func TestStackOutput(t *testing.T) {}

func TestStackAllOutput(t *testing.T) {}

func TestStackPanic(t *testing.T) {}

func BenchmarkStackCopyPtr(b *testing.B) {}

func countp(n *int) {}

func BenchmarkStackCopy(b *testing.B) {}

func count(n int) int {}

func BenchmarkStackCopyNoCache(b *testing.B) {}

func count1(n int) int {}

func count2(n int) int  {}

func count3(n int) int  {}

func count4(n int) int  {}

func count5(n int) int  {}

func count6(n int) int  {}

func count7(n int) int  {}

func count8(n int) int  {}

func count9(n int) int  {}

func count10(n int) int {}

func count11(n int) int {}

func count12(n int) int {}

func count13(n int) int {}

func count14(n int) int {}

func count15(n int) int {}

func count16(n int) int {}

func count17(n int) int {}

func count18(n int) int {}

func count19(n int) int {}

func count20(n int) int {}

func count21(n int) int {}

func count22(n int) int {}

func count23(n int) int {}

type stkobjT

// Sum creates a linked list of stkobjTs.
func Sum(n int64, p *stkobjT) {}

func BenchmarkStackCopyWithStkobj(b *testing.B) {}

func BenchmarkIssue18138(b *testing.B) {}

func useStackPtrs(n int, b bool) {}

type structWithMethod

func (s structWithMethod) caller() string {}

func (s structWithMethod) callers() []uintptr {}

func (s structWithMethod) stack() string {}

func (s structWithMethod) nop() {}

func (s structWithMethod) inlinablePanic() {}

func TestStackWrapperCaller(t *testing.T) {}

func TestStackWrapperCallers(t *testing.T) {}

func TestStackWrapperStack(t *testing.T) {}

func TestStackWrapperStackInlinePanic(t *testing.T) {}

type I

func TestStackWrapperStackPanic(t *testing.T) {}

func testStackWrapperPanic(t *testing.T, cb func(), expect string) {}

func TestCallersFromWrapper(t *testing.T) {}

func TestTracebackSystemstack(t *testing.T) {}

func TestTracebackAncestors(t *testing.T) {}

// Test that defer closure is correctly scanned when the stack is scanned.
func TestDeferLiveness(t *testing.T) {}

func TestDeferHeapAndStack(t *testing.T) {}

// deferHeapAndStack(n) computes 2*n
func deferHeapAndStack(n int) (r int) {}

var escapeMe

func TestFramePointerAdjust(t *testing.T) {}

// TestSystemstackFramePointerAdjust is a regression test for issue 59692 that
// ensures that the frame pointer of systemstack is correctly adjusted. See CL
// 489015 for more details.
func TestSystemstackFramePointerAdjust(t *testing.T) {}

// growAndShrinkStack grows the stack of the current goroutine in order to
// shrink it again and verify that all frame pointers on the new stack have
// been correctly adjusted. stackBallast is used to ensure we're not depending
// on the current heuristics of stack shrinking too much.
func growAndShrinkStack(n int, stackBallast [1024]byte) {}