The following series of patches fixes a number of test failures when running
the GCC DejaGNU testsuite for msp430-elf.

The raw output from contrib/compare_tests is a bit misleading for some tests,
as lines have been added to the source code, changing line numbers for
dg-warning/dg-error tests. I verified there are no regressions
or new failures for x86_64-pc-linux-gnu (gcc, g++), avr (gcc) and msp430-elf
with the small and large memory model (gcc, g++).

For the msp430 small memory model (default) here are the summary results:

BEFORE:
        === gcc Summary ===
# of expected passes 90663
        # of unexpected failures        447
        # of unexpected successes       6
        # of expected failures          287
        # of unresolved testcases       93
        # of unsupported tests          4171
=== g++ Summary === # of expected passes 99772
        # of unexpected failures        2673
        # of expected failures          433
        # of unresolved testcases       1812
        # of unsupported tests          5862

AFTER:
        === gcc Summary ===

        # of expected passes            90750
        # of unexpected failures        150
        # of unexpected successes       3
        # of expected failures          295
        # of unresolved testcases       14
        # of unsupported tests          4313

        === g++ Summary ===

        # of expected passes            99804
        # of unexpected failures        706
        # of expected failures          436
        # of unresolved testcases       46
        # of unsupported tests          7778

For the -mlarge configuration here are the summary results:
BEFORE:
        === gcc Summary ===

        # of expected passes            90451
        # of unexpected failures        590
        # of unexpected successes       7
        # of expected failures          286
        # of unresolved testcases       162
        # of unsupported tests          4172

        === g++ Summary ===

        # of expected passes            99509
        # of unexpected failures        2885
        # of expected failures          433
        # of unresolved testcases       1875
        # of unsupported tests          5862

AFTER:
        === gcc Summary ===

        # of expected passes            90641
        # of unexpected failures        154
        # of unexpected successes       3
        # of expected failures          293
        # of unresolved testcases       32
        # of unsupported tests          4355

        === g++ Summary ===

        # of expected passes            99529
        # of unexpected failures        949
        # of expected failures          436
        # of unresolved testcases       128
        # of unsupported tests          7759


The "before" results do not include the "obvious" testsuites changes committed
in r265924, r265926, r265927, r265928,
(https://gcc.gnu.org/ml/gcc-patches/2018-11/msg00618.html)
but the "after" results do.

Patch 1 tweaks dg directives in tests specifically for msp430. Many of
these are extensions to existing target selectors in dg directives.

Patch 2 fixes issues finding libssp when linking tests or checking for
fstack_protector support.

Patch 3 sets up require-effective-target directives for tests which
require the compilation of large arrays.
Targets which have 16-bit or 20-bit size_t fail to compile tests with large
arrays designed to test 32-bit or 64-bit behaviour. Rather than enumerating
another target to skip, I've replaced the target selector in some tests with
a size checking procedure:
- size20plus (new)
- size32plus
size20plus checks to see if a 16-bit structure/array size is supported,
similarly to how the existing size32plus checks to see if a 24-bit
structure/array size is supported,

Patch 4 fixes tests when int is 16-bits by default.

Patch 5 deals with ISO C errors emitted by tests when the large memory model is
used. size_t and ptrdiff_t are __int20 with -mlarge, and if the test is
compiled with -pedantic-errors and -std=* or -ansi, then use of these types
causes an error of the form:
  ISO C does not support __int20 types
I fixed this by adding dg-prune-output directives to tests which cause this
error.
Alternatively, I considered adding typedefs preceded by  __extension__ to fix
these errors, but in many cases __SIZE_TYPE__ is directly used so replacing all
these with a new typedef'd type changes the code in more places, in some cases
changing the offset for dg-warning or dg-error directives. Changing the line
numbers for dg-warning/dg-error adds further manual steps to comparing
testresults and as these are generic tests I wanted to minimize the effect on
the testresults for other targets.

Patch 6 fixes tests expecting printf float support for targets which have been
configured with "newlib-nano-formatted-io". When newlib is configured in this
way, float printf is enabled at build time by registering _printf_float as an
undefined symbol.

Patch 7 fixes tests for msp430-elf in the large memory model.

Ok for trunk?

Reply via email to