aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/savedregs.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2004-11-03 14:46:18 +0000
committerAndrew Cagney <cagney@redhat.com>2004-11-03 14:46:18 +0000
commita1e167bbea08cc5f2f846de9f556c73e2c688e73 (patch)
tree869049b3c7630ba602ff164607ca538216f90c0b /gdb/testsuite/gdb.base/savedregs.c
parent4577593c76eba3ba0a0b5078e21e6a0b7beb21e2 (diff)
downloadgdb-a1e167bbea08cc5f2f846de9f556c73e2c688e73.zip
gdb-a1e167bbea08cc5f2f846de9f556c73e2c688e73.tar.gz
gdb-a1e167bbea08cc5f2f846de9f556c73e2c688e73.tar.bz2
2004-11-03 Andrew Cagney <cagney@gnu.org>
* gdb.base/savedregs.exp, gdb.base/savedregs.c: New files.
Diffstat (limited to 'gdb/testsuite/gdb.base/savedregs.c')
-rw-r--r--gdb/testsuite/gdb.base/savedregs.c56
1 files changed, 56 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.base/savedregs.c b/gdb/testsuite/gdb.base/savedregs.c
new file mode 100644
index 0000000..6709eb1
--- /dev/null
+++ b/gdb/testsuite/gdb.base/savedregs.c
@@ -0,0 +1,56 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2004 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.
+
+*/
+
+#include <stdio.h>
+#include <string.h>
+#include <signal.h>
+#include <sys/time.h>
+
+static volatile int done;
+
+extern int
+callee (int param)
+{
+ return param * done + 1;
+}
+
+extern int
+caller (int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8)
+{
+ return callee (a1 << a2 * a3 / a4 + a6 & a6 % a7 - a8) + done;
+}
+
+static void
+catcher (int sig)
+{
+ done = 1;
+} /* handler */
+
+static void
+thrower (void)
+{
+ *(char *)0 = 0;
+}
+
+main ()
+{
+ signal (SIGSEGV, catcher);
+ thrower ();
+}