Blame SOURCES/gdb-6.7-ppc-clobbered-registers-O2-test.patch

e1d87d
2007-11-04  Jan Kratochvil  <jan.kratochvil@redhat.com>
e1d87d
e1d87d
	* gdb.arch/ppc-clobbered-registers-O2.exp: `powerpc64' changed to
e1d87d
	`powerpc*'.
e1d87d
e1d87d
Testcase for:
e1d87d
e1d87d
http://sourceware.org/ml/gdb-patches/2007-09/msg00228.html
e1d87d
e1d87d
2007-10-21  Luis Machado  <luisgpm@br.ibm.com>
e1d87d
e1d87d
	* rs6000-tdep.c (ppc_dwarf2_frame_init_reg): New function.
e1d87d
	* (rs6000_gdbarch_init): Install ppc_dwarf2_frame_init_reg as
e1d87d
	default dwarf2_frame_set_init_reg function.
e1d87d
e1d87d
--- /dev/null	1 Jan 1970 00:00:00 -0000
e1d87d
+++ ./gdb/testsuite/gdb.arch/ppc-clobbered-registers-O2.c	3 Nov 2007 22:22:28 -0000
e1d87d
@@ -0,0 +1,21 @@
e1d87d
+
e1d87d
+unsigned * __attribute__((noinline))
e1d87d
+start_sequence (unsigned * x, unsigned * y)
e1d87d
+{
e1d87d
+	return (unsigned *)0xdeadbeef;
e1d87d
+};
e1d87d
+
e1d87d
+unsigned __attribute__((noinline))
e1d87d
+gen_movsd (unsigned * operand0, unsigned * operand1)
e1d87d
+{
e1d87d
+	return *start_sequence(operand0, operand1);
e1d87d
+}
e1d87d
+
e1d87d
+int main(void)
e1d87d
+{
e1d87d
+  unsigned x, y;
e1d87d
+
e1d87d
+  x = 13;
e1d87d
+  y = 14;
e1d87d
+  return (int)gen_movsd (&x, &y);
e1d87d
+}
e1d87d
--- /dev/null	1 Jan 1970 00:00:00 -0000
e1d87d
+++ ./gdb/testsuite/gdb.arch/ppc-clobbered-registers-O2.exp	3 Nov 2007 22:22:28 -0000
e1d87d
@@ -0,0 +1,54 @@
e1d87d
+# Copyright 2006 Free Software Foundation, Inc.
e1d87d
+#
e1d87d
+# This program is free software; you can redistribute it and/or modify
e1d87d
+# it under the terms of the GNU General Public License as published by
e1d87d
+# the Free Software Foundation; either version 2 of the License, or
e1d87d
+# (at your option) any later version.
e1d87d
+#
e1d87d
+# This program is distributed in the hope that it will be useful,
e1d87d
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
e1d87d
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
e1d87d
+# GNU General Public License for more details.
e1d87d
+#
e1d87d
+# You should have received a copy of the GNU General Public License
e1d87d
+# along with this program; if not, write to the Free Software
e1d87d
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
e1d87d
+#
e1d87d
+# This file is part of the gdb testsuite.
e1d87d
+
e1d87d
+# Test displaying call clobbered registers in optimized binaries for ppc.
e1d87d
+# GDB should not show incorrect values.
e1d87d
+
e1d87d
+if ![istarget "powerpc*-*"] then {
e1d87d
+    verbose "Skipping powerpc* call clobbered registers testing."
e1d87d
+    return
e1d87d
+}
e1d87d
+
e1d87d
+set testfile "ppc-clobbered-registers-O2"
e1d87d
+set srcfile ${testfile}.c
e1d87d
+set binfile [standard_output_file ${testfile}]
e1d87d
+set compile_flags "debug additional_flags=-O2"
e1d87d
+
e1d87d
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable ${compile_flags}] != "" } {
e1d87d
+    unsupported "Testcase compile failed."
e1d87d
+    return -1
e1d87d
+}
e1d87d
+
e1d87d
+gdb_exit
e1d87d
+gdb_start
e1d87d
+gdb_reinitialize_dir $srcdir/$subdir
e1d87d
+gdb_load ${binfile}
e1d87d
+
e1d87d
+if ![runto_main] then {
e1d87d
+    perror "Couldn't run to breakpoint"
e1d87d
+    continue
e1d87d
+}
e1d87d
+
e1d87d
+gdb_test "b start_sequence" ".*Breakpoint 2 at.*line 6.*" \
e1d87d
+  "Insert breakpoint at problematic function"
e1d87d
+
e1d87d
+gdb_test continue ".*Breakpoint 2.*in start_sequence.*" \
e1d87d
+  "Run until problematic function"
e1d87d
+
e1d87d
+gdb_test backtrace ".*operand0=<value optimized out>.*operand1=<value optimized out>.*" \
e1d87d
+  "Check value of call clobbered registers"