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

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