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

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