On Mon, 25 Jul 2022, Tom Honermann via Gcc-patches wrote:

> This change provides new tests for the core language and compiler
> dependent library changes adopted for C2X via WG14 N2653.

I'd expect this patch also to add tests verifying that u8"" strings have 
the old type for C11 (unless there are existing such tests, but I don't 
see them).

> diff --git a/gcc/testsuite/gcc.dg/atomic/c2x-stdatomic-lockfree-char8_t.c 
> b/gcc/testsuite/gcc.dg/atomic/c2x-stdatomic-lockfree-char8_t.c
> new file mode 100644
> index 00000000000..37ea4c8926c
> --- /dev/null
> +++ b/gcc/testsuite/gcc.dg/atomic/c2x-stdatomic-lockfree-char8_t.c
> @@ -0,0 +1,42 @@
> +/* Test atomic_is_lock_free for char8_t.  */
> +/* { dg-do run } */
> +/* { dg-options "-std=c2x -D_ISOC2X_SOURCE -pedantic-errors" } */

I don't think _ISOC2X_SOURCE belongs in any GCC tests.

> diff --git a/gcc/testsuite/gcc.dg/atomic/gnu2x-stdatomic-lockfree-char8_t.c 
> b/gcc/testsuite/gcc.dg/atomic/gnu2x-stdatomic-lockfree-char8_t.c
> new file mode 100644
> index 00000000000..a017b134817
> --- /dev/null
> +++ b/gcc/testsuite/gcc.dg/atomic/gnu2x-stdatomic-lockfree-char8_t.c
> @@ -0,0 +1,5 @@
> +/* Test atomic_is_lock_free for char8_t with -std=gnu2x.  */
> +/* { dg-do run } */
> +/* { dg-options "-std=gnu2x -D_GNU_SOURCE -pedantic-errors" } */

Nor does _GNU_SOURCE (unless the test depends on glibc functionality 
that's only available with _GNU_SOURCE, but in that case you also need 
some effective-target conditionals to restrict it to appropriate glibc 
targets).

-- 
Joseph S. Myers
jos...@codesourcery.com

Reply via email to