bug-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bison 3.5.93 on AIX 7.1


From: Akim Demaille
Subject: Re: Bison 3.5.93 on AIX 7.1
Date: Mon, 4 May 2020 06:12:24 +0200

Hi Bruno!

> Le 3 mai 2020 à 22:03, Bruno Haible <address@hidden> a écrit :
> 
> On AIX 7.1, when building with xlc in 32-bit mode, there are
> two test failures:
> 527: GNU AWK 3.1.0 Grammar: IELR(1)                  FAILED (existing.at:801)
> 533: GNU pic (Groff 1.18.1) Grammar: IELR(1)         FAILED (existing.at:3266)
> 
> Detailed configuration:
> 
> CC="xlc -qthreaded -qtls"; CXX="xlC -qthreaded -qtls"; export CC CXX
> unset AR
> 
> Detailed test results: attached.

The problem appears to be that "diff -u" is not formatted as expected,
as shows this diff of "diff -u":

2,9c2,9
<    156         | . '$' non_post_simp_exp
< 
<      NAME  shift, and go to state 9
< -    '$'   shift, and go to state 24
< +    '$'   shift, and go to state 320
< 
<      NAME      [reduce using rule 152 (opt_variable)]
<      '$'       [reduce using rule 152 (opt_variable)]
---
>     156         | . '$' non_post_simp_exp
>   
>       NAME  shift, and go to state 9
> -     '$'   shift, and go to state 24
> +     '$'   shift, and go to state 320
>   
>       NAME      [reduce using rule 152 (opt_variable)]
>       '$'       [reduce using rule 152 (opt_variable)]

This should address this problem.

Thanks!

commit eed3d2ebcebbab9de1db5e2afe57ec7bf750dfd7
Author: Akim Demaille <address@hidden>
Date:   Mon May 4 06:06:33 2020 +0200

    tests: beware of portability issues with diff -u
    
    AIX 7.1 supports diff -u, but its output does not match the expected
    one.
    Reported by Bruno Haible.
    https://lists.gnu.org/r/bug-bison/2020-05/msg00049.html
    
    * tests/atlocal.in (DIFF_U_WORKS): New.
    * tests/local.at (AT_DIFF_U_CHECK): New.
    * tests/existing.at (_AT_TEST_EXISTING_GRAMMAR): Use AT_DIFF_U_CHECK.

diff --git a/tests/atlocal.in b/tests/atlocal.in
index 71579802..2f667b05 100644
--- a/tests/atlocal.in
+++ b/tests/atlocal.in
@@ -144,3 +144,45 @@ export LC_CTYPE
 
 # Empty if no xsltproc was found
 : ${XSLTPROC='@XSLTPROC@'}
+
+
+# Some tests expect a precise diff format.  See AT_DIFF_U_CHECK.
+# See https://lists.gnu.org/r/bug-bison/2020-05/msg00049.html.
+cat >conftest.1 <<EOF
+1
+2
+3
+4
+5
+6
+EOF
+
+cat >conftest.2 <<EOF
+1
+22
+3
+4
+55
+6
+EOF
+
+cat >conftest.expected <<EOF
+@@ -1,6 +1,6 @@
+ 1
+-2
++22
+ 3
+ 4
+-5
++55
+ 6
+EOF
+
+diff -u conftest.1 conftest.2 2>/dev/null | sed -n '/^@@/,$p' | sed 's/^ $//' 
>conftest.diff
+if diff conftest.expected conftest.diff >/dev/null; then
+    DIFF_U_WORKS=true
+else
+    DIFF_U_WORKS=false
+fi
+echo "DIFF_U_WORKS: $DIFF_U_WORKS"
+rm conftest.*
diff --git a/tests/existing.at b/tests/existing.at
index 672beecb..da6287d5 100644
--- a/tests/existing.at
+++ b/tests/existing.at
@@ -35,14 +35,9 @@ dnl time comes, just use sed to drop the line numbers.  For 
now, as LR(1)
 dnl support is rapidly evolving, let's keep that information to be careful.
 dnl However, we don't do diffs for canonical LR(1) because the diff is huge.
 m4_pushdef([AT_LALR1_DIFF_CHECK],
-[dnl We need diff -u, which is not portable.
-AT_CHECK([diff -u /dev/null /dev/null || exit 77], [0], [ignore])
-
-AT_CHECK([[sed 's/^%define lr.type .*$//' input.y > input-lalr.y]])
+[AT_CHECK([[sed 's/^%define lr.type .*$//' input.y > input-lalr.y]])
 AT_BISON_CHECK([[--report=all input-lalr.y]], [[0]], [ignore], [ignore])
-AT_CHECK([[diff -u input-lalr.output input.output \
-           | sed -n '/^@@/,$p' | sed 's/^ $//']],
-         [[0]], [$1])])
+AT_DIFF_U_CHECK([[input-lalr.output input.output]], [$1])])
 
 AT_TEST_TABLES_AND_PARSE([$2[: LALR(1)]], [[LALR]], [[last-state]],
                          [[%define lr.type lalr
diff --git a/tests/local.at b/tests/local.at
index 97ff0e8b..11d367fc 100644
--- a/tests/local.at
+++ b/tests/local.at
@@ -83,6 +83,16 @@ set x `LC_ALL=C ls -l '$1'` &&
 ## ------------- ##
 
 
+# AT_DIFF_U_CHECK(DIFF-ARGS, EXPECTED-DIFF)
+# -----------------------------------------
+# If diff -u works as we expect, use it, with headers stripped.
+m4_define([AT_DIFF_U_CHECK],
+[if $DIFF_U_WORKS; then
+  AT_CHECK([diff -u $1 | sed -n '/^@@/,$p' | sed 's/^ $//'], [0], [$2])
+fi
+])
+
+
 # AT_PERL_CHECK(PERL-ARGS, ...)
 # -----------------------------
 # If Perl is available, run this test.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]