1 /* This testcase is part of GDB, the GNU debugger.
3 Copyright 2004-2024 Free Software Foundation, Inc.
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20 void stack_check_probe_1 (void);
21 void stack_check_probe_2 (void);
22 void stack_check_probe_loop_1 (void);
23 void stack_check_probe_loop_2 (void);
29 stack_check_probe_1 ();
30 stack_check_probe_2 ();
31 stack_check_probe_loop_1 ();
32 stack_check_probe_loop_2 ();
36 /* Asm for procedure li_stw().
38 The purpose of this function is to verify that GDB does not
39 include the li insn as part of the function prologue (only part
40 of the prologue if part of a pair of insns saving vector registers).
41 Similarly, GDB should not include the stw insn following the li insn,
42 because the source register is not used for parameter passing. */
45 asm (" .csect .text[PR]\n"
48 " .csect li_stw[DS]\n"
50 " .long .li_stw, TOC[tc0], 0\n"
63 /* Asm for procedure stack_check_probe_1().
65 The purpose of this function is to verify that GDB can skip the stack
66 checking probing at the beginning of the prologue. */
68 asm (" .csect .text[PR]\n"
70 " .globl stack_check_probe_1\n"
71 " .globl .stack_check_probe_1\n"
72 " .csect stack_check_probe_1[DS]\n"
73 "stack_check_probe_1:\n"
74 " .long .stack_check_probe_1, TOC[tc0], 0\n"
76 ".stack_check_probe_1:\n"
85 /* Asm for procedure stack_check_probe_2 ().
87 Similar to stack_check_probe_1, but with a different probing sequence
90 asm (" .csect .text[PR]\n"
92 " .globl stack_check_probe_2\n"
93 " .globl .stack_check_probe_2\n"
94 " .csect stack_check_probe_2[DS]\n"
95 "stack_check_probe_2:\n"
96 " .long .stack_check_probe_2, TOC[tc0], 0\n"
98 ".stack_check_probe_2:\n"
107 " stwu 1,-16464(1)\n"
115 /* Asm for procedure stack_check_probe_loop_1() and stack_check_probe_loop_2().
117 Similar to stack_check_probe_1, but with a different probing sequence
120 asm (" .csect .text[PR]\n"
122 " .globl stack_check_probe_loop_1\n"
123 " .globl .stack_check_probe_loop_1\n"
124 " .csect stack_check_probe_loop_1[DS]\n"
125 "stack_check_probe_loop_1:\n"
126 " .long .stack_check_probe_loop_1, TOC[tc0], 0\n"
127 " .csect .text[PR]\n"
128 ".stack_check_probe_loop_1:\n"
129 " addi 12,1,-12288\n"
136 " addi 12,12,-4096\n"
154 asm (" .csect .text[PR]\n"
156 " .globl stack_check_probe_loop_2\n"
157 " .globl .stack_check_probe_loop_2\n"
158 " .csect stack_check_probe_loop_2[DS]\n"
159 "stack_check_probe_loop_2:\n"
160 " .long .stack_check_probe_loop_2, TOC[tc0], 0\n"
161 " .csect .text[PR]\n"
162 ".stack_check_probe_loop_2:\n"
163 " addi 12,1,-12288\n"
169 " addi 12,12,-4096\n"