On 11/20/22 03:02, Dimitar Dimitrov wrote:
The new analyzer tests for sockets are failing on embedded targets.
The newlib and avr-libc C libraries do not support sockets.

At first I considered a coarse filtering on the existing
effective_target_freestanding check.  But seeing how lib/target-supports.exp
is slowly turning into a copy of autotools, I kept the tradition and added
a new fine grained "socket" filter.

I also considered adding effective_target_posix, but could not
figure out a reliable C code to perform the check.

Testing done:
   - No changes in gcc.sum for x86_64-pc-linux-gnu, with or without this
     patch.
   - Filtered cases are now UNSUPPORTED instead of failing on AVR and PRU
     backends.

Ok for trunk?

gcc/ChangeLog:

        * doc/sourcebuild.texi (sockets): Document new check.

gcc/testsuite/ChangeLog:

        * gcc.dg/analyzer/fd-accept.c: Require sockets.
        * gcc.dg/analyzer/fd-bind.c: Ditto.
        * gcc.dg/analyzer/fd-connect.c: Ditto.
        * gcc.dg/analyzer/fd-datagram-socket.c: Ditto.
        * gcc.dg/analyzer/fd-glibc-byte-stream-connection-server.c:
        Ditto.
        * gcc.dg/analyzer/fd-glibc-byte-stream-socket.c: Ditto.
        * gcc.dg/analyzer/fd-glibc-datagram-client.c: Ditto.
        * gcc.dg/analyzer/fd-glibc-datagram-socket.c: Ditto.
        * gcc.dg/analyzer/fd-listen.c: Ditto.
        * gcc.dg/analyzer/fd-manpage-getaddrinfo-client.c: Ditto.
        * gcc.dg/analyzer/fd-mappage-getaddrinfo-server.c: Ditto.
        * gcc.dg/analyzer/fd-meaning.c: Ditto.
        * gcc.dg/analyzer/fd-socket-meaning.c: Ditto.
        * gcc.dg/analyzer/fd-socket-misuse.c: Ditto.
        * gcc.dg/analyzer/fd-stream-socket-active-open.c: Ditto.
        * gcc.dg/analyzer/fd-stream-socket-passive-open.c: Ditto.
        * gcc.dg/analyzer/fd-stream-socket.c: Ditto.
        * gcc.dg/analyzer/fd-symbolic-socket.c: Ditto.
        * lib/target-supports.exp (check_effective_target_sockets): New
        check.

OK

jeff


Reply via email to