Text file src/cmd/link/internal/ld/testdata/stackcheck/main.s

     1  // Copyright 2022 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  #define NOSPLIT 7
     6  #define NOFRAME 512
     7  
     8  TEXT ·asmMain(SB),0,$0-0
     9  	CALL ·startSelf(SB)
    10  	CALL ·startChain(SB)
    11  	CALL ·startRec(SB)
    12  	RET
    13  
    14  // Test reporting of basic over-the-limit
    15  TEXT ·startSelf(SB),NOSPLIT,$1000-0
    16  	RET
    17  
    18  // Test reporting of multiple over-the-limit chains
    19  TEXT ·startChain(SB),NOSPLIT,$16-0
    20  	CALL ·chain0(SB)
    21  	CALL ·chain1(SB)
    22  	CALL ·chain2(SB)
    23  	RET
    24  TEXT ·chain0(SB),NOSPLIT,$32-0
    25  	CALL ·chainEnd(SB)
    26  	RET
    27  TEXT ·chain1(SB),NOSPLIT,$48-0 // Doesn't go over
    28  	RET
    29  TEXT ·chain2(SB),NOSPLIT,$64-0
    30  	CALL ·chainEnd(SB)
    31  	RET
    32  TEXT ·chainEnd(SB),NOSPLIT,$1000-0 // Should be reported twice
    33  	RET
    34  
    35  // Test reporting of rootless recursion
    36  TEXT ·startRec(SB),NOSPLIT|NOFRAME,$0-0
    37  	CALL ·startRec0(SB)
    38  	RET
    39  TEXT ·startRec0(SB),NOSPLIT|NOFRAME,$0-0
    40  	CALL ·startRec(SB)
    41  	RET
    42  

View as plain text