Home | History | Annotate | Line # | Download | only in gdb.arch
aarch64-prologue.c revision 1.1
      1  1.1  christos /* This testcase is part of GDB, the GNU debugger.
      2  1.1  christos 
      3  1.1  christos    Copyright 2019-2020 Free Software Foundation, Inc.
      4  1.1  christos 
      5  1.1  christos    This program is free software; you can redistribute it and/or modify
      6  1.1  christos    it under the terms of the GNU General Public License as published by
      7  1.1  christos    the Free Software Foundation; either version 3 of the License, or
      8  1.1  christos    (at your option) any later version.
      9  1.1  christos 
     10  1.1  christos    This program is distributed in the hope that it will be useful,
     11  1.1  christos    but WITHOUT ANY WARRANTY; without even the implied warranty of
     12  1.1  christos    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     13  1.1  christos    GNU General Public License for more details.
     14  1.1  christos 
     15  1.1  christos    You should have received a copy of the GNU General Public License
     16  1.1  christos    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
     17  1.1  christos 
     18  1.1  christos #include <stdio.h>
     19  1.1  christos 
     20  1.1  christos extern void excessiveprologue ();
     21  1.1  christos 
     22  1.1  christos void
     23  1.1  christos innerfunc ()
     24  1.1  christos {
     25  1.1  christos   printf ("inner\n");
     26  1.1  christos }
     27  1.1  christos 
     28  1.1  christos /* excessiveprologue saves to the stack in multiple ways.  */
     29  1.1  christos 
     30  1.1  christos asm ("\t.section .gnu.sgstubs,\"ax\",%progbits\n"
     31  1.1  christos      "\t.global excessiveprologue\n"
     32  1.1  christos      "\t.type excessiveprologue, %function\n"
     33  1.1  christos      "excessiveprologue:\n"
     34  1.1  christos      "\tstp	x29, x30, [sp, #-208]!\n"
     35  1.1  christos      "\tmov	x29, sp\n"
     36  1.1  christos      "\tstp	w0,w1,[sp,16]\n"
     37  1.1  christos      "\tstp	x2,x3,[sp,24]\n"
     38  1.1  christos      "\tstr	w4,[sp,40]\n"
     39  1.1  christos      "\tstr	x5,[sp,48]\n"
     40  1.1  christos      "\tstur	w6,[sp,52]\n"
     41  1.1  christos      "\tstur	x7,[sp,56]\n"
     42  1.1  christos      "\tstp	s0,s1,[sp,64]\n"
     43  1.1  christos      "\tstp	d2,d3,[sp,72]\n"
     44  1.1  christos      "\tstp	q4,q5,[sp,96]\n"
     45  1.1  christos      "\tstr	b6,[sp,128]\n"
     46  1.1  christos      "\tstr	h7,[sp,132]\n"
     47  1.1  christos      "\tstr	s8,[sp,136]\n"
     48  1.1  christos      "\tstr	d9,[sp,140]\n"
     49  1.1  christos      "\tstr	q10,[sp,148]\n"
     50  1.1  christos      "\tstur	b11,[sp,164]\n"
     51  1.1  christos      "\tstur	h12,[sp,160]\n"
     52  1.1  christos      "\tstur	s13,[sp,172]\n"
     53  1.1  christos      "\tstur	d14,[sp,176]\n"
     54  1.1  christos      "\tstur	q15,[sp,184]\n"
     55  1.1  christos      "\tbl innerfunc\n"
     56  1.1  christos      "\tldp	w0,w1,[sp,16]\n"
     57  1.1  christos      "\tldp	x2,x3,[sp,24]\n"
     58  1.1  christos      "\tldr	w4,[sp,40]\n"
     59  1.1  christos      "\tldr	x5,[sp,48]\n"
     60  1.1  christos      "\tldur	w6,[sp,52]\n"
     61  1.1  christos      "\tldur	x7,[sp,56]\n"
     62  1.1  christos      "\tldp	s0,s1,[sp,64]\n"
     63  1.1  christos      "\tldp	d2,d3,[sp,72]\n"
     64  1.1  christos      "\tldp	q4,q5,[sp,96]\n"
     65  1.1  christos      "\tldr	b6,[sp,128]\n"
     66  1.1  christos      "\tldr	h7,[sp,132]\n"
     67  1.1  christos      "\tldr	s8,[sp,136]\n"
     68  1.1  christos      "\tldr	d9,[sp,140]\n"
     69  1.1  christos      "\tldr	q10,[sp,148]\n"
     70  1.1  christos      "\tldur	b11,[sp,164]\n"
     71  1.1  christos      "\tldur	h12,[sp,160]\n"
     72  1.1  christos      "\tldur	s13,[sp,172]\n"
     73  1.1  christos      "\tldur	d14,[sp,176]\n"
     74  1.1  christos      "\tldur	q15,[sp,184]\n"
     75  1.1  christos      "\tldp	x29, x30, [sp], #208\n"
     76  1.1  christos      "ret\n");
     77  1.1  christos 
     78  1.1  christos int
     79  1.1  christos main (void)
     80  1.1  christos {
     81  1.1  christos   excessiveprologue ();
     82  1.1  christos   return 0;
     83  1.1  christos }
     84