This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[ARI patch] Verify cross-arch .S testsuite files compatibility
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Wed, 14 Mar 2012 21:26:53 +0100
- Subject: [ARI patch] Verify cross-arch .S testsuite files compatibility
Hi,
as the issues like
[SH] gdb.dwarf2 tests: use .byte4 instead of .long
http://sourceware.org/ml/gdb-patches/2012-03/msg00447.html
are repeating and I failed to properly runtime check it from lib/gdb.exp
providing at least ARI-time checker here.
I guess gdb_ari.sh currently does not run for *.S files, this patch sure needs
to run it for:
gdb/testsuite/*/*.[Ss]
This ARI patch requires
[testuite patch] Fix cross-arch .S testsuite files compatibility
posted along to make it quiet.
Thanks,
Jan
* gdb_ari.sh (hash): Do not apply for *.[sS] files.
(asmhash, asmapp, asmlong, asmvalue): New tests.
(false, true): Do not apply for gdb.arch/ and gdb.disasm/.
--- /home/jkratoch/t/gdb_ari.sh-orig 2012-03-14 20:15:48.804209849 +0100
+++ /home/jkratoch/t/gdb_ari.sh 2012-03-14 20:57:07.255866311 +0100
@@ -590,10 +590,53 @@ parse a C preprocessor directive when `#
the line)"
category["hash"] = ari_regression
}
-/^[[:space:]]+#/ {
+/^[[:space:]]+#/ \
+&& FILENAME !~ /\.[sS]$/ {
fail("hash")
}
+BEGIN { doc["asmhash"] = "\
+Do not use `# comment'\'', instead use `/* comment */'\'' (assemblers of some \
+architectures such as m68k do not parse # correctly."
+ category["asmhash"] = ari_regression
+}
+/#/ \
+&& !/^#[[:space:]]*(if|ifdef|ifndef|else|elif|endif|define|undef|include|error|APP|NO_APP)\>/ \
+&& FILENAME ~ /\.[sS]$/ \
+&& FILENAME !~ /\/gdb\.(arch|disasm)\// {
+ # gdb.arch | gdb.disasm may need # for constant on some archs.
+ fail("asmhash")
+}
+
+BEGIN { doc["asmapp"] = "\
+Do not use `#APP'\'' or `#NO_APP'\'', they are not needed in GDB testcases."
+ category["asmapp"] = ari_regression
+}
+/^#(APP|NO_APP)$/ \
+&& FILENAME ~ /\.[sS]$/ {
+ fail("asmapp")
+}
+
+BEGIN { doc["asmlong"] = "\
+Do not use `.long'\'', instead use `.4byte'\'' (assemblers of some \
+architectures such as sh do not parse .long correctly"
+ category["asmlong"] = ari_regression
+}
+/\.long\>/ \
+&& FILENAME ~ /\.[sS]$/ {
+ fail("asmlong")
+}
+
+BEGIN { doc["asmvalue"] = "\
+Do not use `.value'\'', instead use `.2byte'\'' (assemblers of some \
+architectures such as s390x do not parse .value correctly"
+ category["asmvalue"] = ari_regression
+}
+/\.value\>/ \
+&& FILENAME ~ /\.[sS]$/ {
+ fail("asmvalue")
+}
+
BEGIN { doc["OP eol"] = "\
Do not use &&, or || at the end of a line"
category["OP eol"] = ari_code
@@ -1172,7 +1215,8 @@ BEGIN { doc["false"] = "\
Definitely do not use `false'\'' in boolean expressions"
category["false"] = ari_regression
}
-/(^|[^_[:alnum:]])false([^_[:alnum:]]|$)/ {
+/(^|[^_[:alnum:]])false([^_[:alnum:]]|$)/ \
+&& FILENAME !~ /\/gdb\.(arch|disasm)\// {
if (is_yacc_or_lex == 0) {
fail("false")
}
@@ -1182,7 +1226,8 @@ BEGIN { doc["true"] = "\
Do not try to use `true'\'' in boolean expressions"
category["true"] = ari_regression
}
-/(^|[^_[:alnum:]])true([^_[:alnum:]]|$)/ {
+/(^|[^_[:alnum:]])true([^_[:alnum:]]|$)/ \
+&& FILENAME !~ /\/gdb\.(arch|disasm)\// {
if (is_yacc_or_lex == 0) {
fail("true")
}