Blame SOURCES/gdb-6.7-charsign-test.patch

f9426a
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=224128
f9426a
f9426a
2007-01-25  Jan Kratochvil <jan.kratochvil@redhat.com>
f9426a
f9426a
	* gdb.base/charsign.exp, gdb.base/charsign.c: New files.
f9426a
	[ stripped ]
f9426a
f9426a
2007-10-19  Jan Kratochvil <jan.kratochvil@redhat.com>
f9426a
f9426a
	Port to GDB-6.7 - only the testcase left, patch has been reverted,
f9426a
	char-vectors restricted.
f9426a
f9426a
--- /dev/null	1 Jan 1970 00:00:00 -0000
f9426a
+++ ./gdb/testsuite/gdb.base/charsign.c	26 Jan 2007 10:32:00 -0000
f9426a
@@ -0,0 +1,37 @@
f9426a
+/* This testcase is part of GDB, the GNU debugger.
f9426a
+
f9426a
+   Copyright 2007 Free Software Foundation, Inc.
f9426a
+
f9426a
+   This program is free software; you can redistribute it and/or modify
f9426a
+   it under the terms of the GNU General Public License as published by
f9426a
+   the Free Software Foundation; either version 2 of the License, or
f9426a
+   (at your option) any later version.
f9426a
+
f9426a
+   This program is distributed in the hope that it will be useful,
f9426a
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
f9426a
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
f9426a
+   GNU General Public License for more details.
f9426a
+ 
f9426a
+   You should have received a copy of the GNU General Public License
f9426a
+   along with this program; if not, write to the Free Software
f9426a
+   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
f9426a
+
f9426a
+   Please email any bugs, comments, and/or additions to this file to:
f9426a
+   bug-gdb@prep.ai.mit.edu  */
f9426a
+
f9426a
+int main()
f9426a
+{
f9426a
+  return 0;
f9426a
+}
f9426a
+
f9426a
+char n[]="A";
f9426a
+signed char s[]="A";
f9426a
+unsigned char u[]="A";
f9426a
+
f9426a
+typedef char char_n;
f9426a
+typedef signed char char_s;
f9426a
+typedef unsigned char char_u;
f9426a
+
f9426a
+char_n n_typed[]="A";
f9426a
+char_s s_typed[]="A";
f9426a
+char_u u_typed[]="A";
f9426a
--- /dev/null	1 Jan 1970 00:00:00 -0000
f9426a
+++ ./gdb/testsuite/gdb.base/charsign.exp	26 Jan 2007 10:32:00 -0000
f9426a
@@ -0,0 +1,63 @@
f9426a
+# Copyright 2007 Free Software Foundation, Inc.
f9426a
+
f9426a
+# This program is free software; you can redistribute it and/or modify
f9426a
+# it under the terms of the GNU General Public License as published by
f9426a
+# the Free Software Foundation; either version 2 of the License, or
f9426a
+# (at your option) any later version.
f9426a
+# 
f9426a
+# This program is distributed in the hope that it will be useful,
f9426a
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
f9426a
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
f9426a
+# GNU General Public License for more details.
f9426a
+# 
f9426a
+# You should have received a copy of the GNU General Public License
f9426a
+# along with this program; if not, write to the Free Software
f9426a
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
f9426a
+
f9426a
+set testfile charsign
f9426a
+set srcfile ${testfile}.c
f9426a
+set binfile ${objdir}/${subdir}/${testfile}
f9426a
+
f9426a
+proc do_test { cflags } {
f9426a
+    global srcdir
f9426a
+    global binfile
f9426a
+    global subdir
f9426a
+    global srcfile
f9426a
+    global gdb_prompt
f9426a
+
f9426a
+    if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug additional_flags=$cflags]] != "" } {
f9426a
+	untested "Couldn't compile test program"
f9426a
+	return -1
f9426a
+    }
f9426a
+
f9426a
+    # Get things started.
f9426a
+
f9426a
+    gdb_exit
f9426a
+    gdb_start
f9426a
+    gdb_reinitialize_dir $srcdir/$subdir
f9426a
+    gdb_load ${binfile}
f9426a
+
f9426a
+    # For C programs, "start" should stop in main().
f9426a
+
f9426a
+    gdb_test "p n" \
f9426a
+	     "= \"A\""
f9426a
+    gdb_test "p s" \
f9426a
+	     "= \\{65 'A', 0 '\\\\0'\\}"
f9426a
+    gdb_test "p u" \
f9426a
+	     "= \\{65 'A', 0 '\\\\0'\\}"
f9426a
+    gdb_test "p n_typed" \
f9426a
+	     "= \"A\""
f9426a
+    gdb_test "p s_typed" \
f9426a
+	     "= \\{65 'A', 0 '\\\\0'\\}"
f9426a
+    gdb_test "p u_typed" \
f9426a
+	     "= \\{65 'A', 0 '\\\\0'\\}"
f9426a
+}
f9426a
+
f9426a
+# The string identification works despite the compiler flags below due to
f9426a
+# gdbtypes.c:
f9426a
+#   if (name && strcmp (name, "char") == 0)
f9426a
+#     TYPE_FLAGS (type) |= TYPE_FLAG_NOSIGN;
f9426a
+
f9426a
+do_test {}
f9426a
+do_test {-fsigned-char}
f9426a
+do_test {-funsigned-char}