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

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