]> git.pld-linux.org Git - packages/gdb.git/blame - gdb-6.7-charsign-test.patch
- NOTE: does not build with -j2
[packages/gdb.git] / gdb-6.7-charsign-test.patch
CommitLineData
3a58abaf
AM
1https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=224128
2
32007-01-25 Jan Kratochvil <jan.kratochvil@redhat.com>
4
5 * gdb.base/charsign.exp, gdb.base/charsign.c: New files.
6 [ stripped ]
7
82007-10-19 Jan Kratochvil <jan.kratochvil@redhat.com>
9
10 Port to GDB-6.7 - only the testcase left, patch has been reverted,
11 char-vectors restricted.
12
13--- /dev/null 1 Jan 1970 00:00:00 -0000
14+++ ./gdb/testsuite/gdb.base/charsign.c 26 Jan 2007 10:32:00 -0000
15@@ -0,0 +1,37 @@
16+/* This testcase is part of GDB, the GNU debugger.
17+
18+ Copyright 2007 Free Software Foundation, Inc.
19+
20+ This program is free software; you can redistribute it and/or modify
21+ it under the terms of the GNU General Public License as published by
22+ the Free Software Foundation; either version 2 of the License, or
23+ (at your option) any later version.
24+
25+ This program is distributed in the hope that it will be useful,
26+ but WITHOUT ANY WARRANTY; without even the implied warranty of
27+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28+ GNU General Public License for more details.
29+
30+ You should have received a copy of the GNU General Public License
31+ along with this program; if not, write to the Free Software
32+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
33+
34+ Please email any bugs, comments, and/or additions to this file to:
35+ bug-gdb@prep.ai.mit.edu */
36+
37+int main()
38+{
39+ return 0;
40+}
41+
42+char n[]="A";
43+signed char s[]="A";
44+unsigned char u[]="A";
45+
46+typedef char char_n;
47+typedef signed char char_s;
48+typedef unsigned char char_u;
49+
50+char_n n_typed[]="A";
51+char_s s_typed[]="A";
52+char_u u_typed[]="A";
53--- /dev/null 1 Jan 1970 00:00:00 -0000
54+++ ./gdb/testsuite/gdb.base/charsign.exp 26 Jan 2007 10:32:00 -0000
55@@ -0,0 +1,70 @@
56+# Copyright 2007 Free Software Foundation, Inc.
57+
58+# This program is free software; you can redistribute it and/or modify
59+# it under the terms of the GNU General Public License as published by
60+# the Free Software Foundation; either version 2 of the License, or
61+# (at your option) any later version.
62+#
63+# This program is distributed in the hope that it will be useful,
64+# but WITHOUT ANY WARRANTY; without even the implied warranty of
65+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
66+# GNU General Public License for more details.
67+#
68+# You should have received a copy of the GNU General Public License
69+# along with this program; if not, write to the Free Software
70+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
71+
72+if $tracelevel then {
73+ strace $tracelevel
74+}
75+
76+set prms_id 0
77+set bug_id 0
78+
79+set testfile charsign
80+set srcfile ${testfile}.c
81+set binfile ${objdir}/${subdir}/${testfile}
82+
83+proc do_test { cflags } {
84+ global srcdir
85+ global binfile
86+ global subdir
87+ global srcfile
88+ global gdb_prompt
89+
90+ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug additional_flags=$cflags]] != "" } {
91+ untested "Couldn't compile test program"
92+ return -1
93+ }
94+
95+ # Get things started.
96+
97+ gdb_exit
98+ gdb_start
99+ gdb_reinitialize_dir $srcdir/$subdir
100+ gdb_load ${binfile}
101+
102+ # For C programs, "start" should stop in main().
103+
104+ gdb_test "p n" \
105+ "= \"A\""
106+ gdb_test "p s" \
107+ "= \\{65 'A', 0 '\\\\0'\\}"
108+ gdb_test "p u" \
109+ "= \\{65 'A', 0 '\\\\0'\\}"
110+ gdb_test "p n_typed" \
111+ "= \"A\""
112+ gdb_test "p s_typed" \
113+ "= \\{65 'A', 0 '\\\\0'\\}"
114+ gdb_test "p u_typed" \
115+ "= \\{65 'A', 0 '\\\\0'\\}"
116+}
117+
118+# The string identification works despite the compiler flags below due to
119+# gdbtypes.c:
120+# if (name && strcmp (name, "char") == 0)
121+# TYPE_FLAGS (type) |= TYPE_FLAG_NOSIGN;
122+
123+do_test {}
124+do_test {-fsigned-char}
125+do_test {-funsigned-char}
This page took 0.040024 seconds and 4 git commands to generate.