aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.arch/gdb1431.c
blob: 00410424913e44537cd45d145c004cd96edcedd7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/* Copyright 2003 Free Software Foundation, Inc.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.
 
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
 
   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
 
   Please email any bugs, comments, and/or additions to this file to:
   bug-gdb@gnu.org
 
   This file is part of the gdb testsuite.  */

void sub1 (void);
void sub2 (void);

main()
{
        sub1();
        sub2();
}

asm(".text\n"
    "    .align 5\n"
    "sub1:\n"
    "    mov.l  r14,@-r15\n"
    "    add    #-128,r15\n"
    "    add    #-128,r15\n"
    "    mov    r15,r14\n"
    "    mov.w  .STACK1,r7\n"
    "    add    r7,r14\n"
    "    mov    r14,r15\n"
    "    mov.l  @r15+,r14\n"
    "    rts\n"
    "    nop\n"
    "    .align 1\n"
    ".STACK1:\n"
    "    .short  256\n");

asm(".text\n"
    "    .align 5\n"
    "sub2:\n"
    "    mov.l  r14,@-r15\n"
    "    mov.w  .STACK2,r3\n"
    "    sub    r3,r15\n"
    "    mov    r15,r14\n"
    "    mov.w  .STACK2,r7\n"
    "    add    r7,r14\n"
    "    mov    r14,r15\n"
    "    mov.l  @r15+,r14\n"
    "    rts\n"
    "    nop\n"
    "    .align 1\n"
    ".STACK2:\n"
    "    .short  260\n");