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

e1d87d
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=224128
e1d87d
e1d87d
2007-01-25  Jan Kratochvil <jan.kratochvil@redhat.com>
e1d87d
e1d87d
	* gdb.base/charsign.exp, gdb.base/charsign.c: New files.
e1d87d
	[ stripped ]
e1d87d
e1d87d
2007-10-19  Jan Kratochvil <jan.kratochvil@redhat.com>
e1d87d
e1d87d
	Port to GDB-6.7 - only the testcase left, patch has been reverted,
e1d87d
	char-vectors restricted.
e1d87d
e1d87d
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/charsign.c
e1d87d
===================================================================
e1d87d
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
e1d87d
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/charsign.c	2016-02-15 23:26:06.429811778 +0100
e1d87d
@@ -0,0 +1,37 @@
e1d87d
+/* This testcase is part of GDB, the GNU debugger.
e1d87d
+
e1d87d
+   Copyright 2007 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
+   Please email any bugs, comments, and/or additions to this file to:
e1d87d
+   bug-gdb@prep.ai.mit.edu  */
e1d87d
+
e1d87d
+int main()
e1d87d
+{
e1d87d
+  return 0;
e1d87d
+}
e1d87d
+
e1d87d
+char n[]="A";
e1d87d
+signed char s[]="A";
e1d87d
+unsigned char u[]="A";
e1d87d
+
e1d87d
+typedef char char_n;
e1d87d
+typedef signed char char_s;
e1d87d
+typedef unsigned char char_u;
e1d87d
+
e1d87d
+char_n n_typed[]="A";
e1d87d
+char_s s_typed[]="A";
e1d87d
+char_u u_typed[]="A";
e1d87d
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/charsign.exp
e1d87d
===================================================================
e1d87d
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
e1d87d
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/charsign.exp	2016-02-15 23:26:12.409854237 +0100
e1d87d
@@ -0,0 +1,63 @@
e1d87d
+# Copyright 2007 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
+set testfile charsign
e1d87d
+set srcfile ${testfile}.c
e1d87d
+set binfile [standard_output_file ${testfile}]
e1d87d
+
e1d87d
+proc do_test { cflags } {
e1d87d
+    global srcdir
e1d87d
+    global binfile
e1d87d
+    global subdir
e1d87d
+    global srcfile
e1d87d
+    global gdb_prompt
e1d87d
+
e1d87d
+    if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug additional_flags=$cflags]] != "" } {
e1d87d
+	untested "Couldn't compile test program"
e1d87d
+	return -1
e1d87d
+    }
e1d87d
+
e1d87d
+    # Get things started.
e1d87d
+
e1d87d
+    gdb_exit
e1d87d
+    gdb_start
e1d87d
+    gdb_reinitialize_dir $srcdir/$subdir
e1d87d
+    gdb_load ${binfile}
e1d87d
+
e1d87d
+    # For C programs, "start" should stop in main().
e1d87d
+
e1d87d
+    gdb_test "p n" \
e1d87d
+	     "= \"A\""
e1d87d
+    gdb_test "p s" \
e1d87d
+	     "= \\{65 'A', 0 '\\\\0'\\}"
e1d87d
+    gdb_test "p u" \
e1d87d
+	     "= \\{65 'A', 0 '\\\\0'\\}"
e1d87d
+    gdb_test "p n_typed" \
e1d87d
+	     "= \"A\""
e1d87d
+    gdb_test "p s_typed" \
e1d87d
+	     "= \\{65 'A', 0 '\\\\0'\\}"
e1d87d
+    gdb_test "p u_typed" \
e1d87d
+	     "= \\{65 'A', 0 '\\\\0'\\}"
e1d87d
+}
e1d87d
+
e1d87d
+# The string identification works despite the compiler flags below due to
e1d87d
+# gdbtypes.c:
e1d87d
+#   if (name && strcmp (name, "char") == 0)
e1d87d
+#     TYPE_FLAGS (type) |= TYPE_FLAG_NOSIGN;
e1d87d
+
e1d87d
+do_test {}
e1d87d
+do_test {-fsigned-char}
e1d87d
+do_test {-funsigned-char}