Commit Graph

2 Commits

Author SHA1 Message Date
Julien Fischer
40401a6b5c Fix hlc test failures with GCC 12.
GCC 12 has new warning, -Winfinite-recursion, that is being triggered by six
tests in the directory tests/valid when compiled in high-level C grades. Since
we also enable -Werror, this is causing these test to fail. Fix these failures
by either removing the infinite recursion from them or by disabling the new GCC
warning for the affected test cases.

configure.ac:
tests/DEFNS_FOR_TESTS.in:
    Define a variable whose value is the option for disabling GCC's infinite
    recursion check.

tests/valid/higher_order5.m:
tests/valid/stack_alloc.m:
    Modify these tests so they do not trigger the infinite recursion warning
    in GCC (or Mercury for that matter).

tests/valid/mode_syntax.m:
tests/valid/same_length_2.m:
    Merge these two tests (under the first name) since they both test the same
    thing.  Delete the same_length_2 version.

tests/valid/Mmakefile:
    Conform to the above deletion.

tests/valid/Mercury.options:
    Include DEFNS_FOR_TESTS here so that mmc --make can see it.

    Disable GCC's infinite recursion check for those tests that trigger
    it.

    Shut up a bunch Mercury warnings for the mode_syntax test case that
    are unrelated to what is actually being tested.
2022-07-04 11:01:13 +10:00
Zoltan Somogyi
44fa78388d Make tests/invalid/foreign_decl_line_number pass.
On my machine, this test has never passed in hlc.gc grade, because you get
extra output from gcc 4.8.1. This diff shuts up this extra output.

configure.ac:
tests/DEFNS_FOR_TESTS.in:
    Record whether the C compiler supports -fno-diagnostics-show-caret
    in the new file tests/DEFNS_FOR_TESTS.

tests/Mmake.common:
    Include tests/DEFNS_FOR_TESTS.

tests/invalid/Mmakefile:
    When invoking the foreign_decl_line_number test, and the related test
    foreign_type_line_number, specify -fno-diagnostics-show-caret
    if this is supported by the C compiler.
2015-02-01 04:03:55 +11:00