]> git.ipfire.org Git - thirdparty/gcc.git/commit
c: Add more C2y tests of initializer constraints
authorJoseph Myers <josmyers@redhat.com>
Thu, 2 Oct 2025 18:06:03 +0000 (18:06 +0000)
committerJoseph Myers <josmyers@redhat.com>
Thu, 2 Oct 2025 18:06:03 +0000 (18:06 +0000)
commita0dde67dd7de04ab26825cecf7cf28e131e19265
treec73b5bb58245bc0146e77c17531b6bfa998a976f
parent60c6f92fb192352d784ab3153a9e11c19a3216a0
c: Add more C2y tests of initializer constraints

Add further tests of C2y requirements on initializers that became
constraints (so requiring diagnostics rather than violations being
undefined behavior) in N3346.

(Some of the tests for invalid string initializers might not cover all
theoretically possible cases, e.g. where char is 64-bit, but should
work on all currently supported targets.)

Tested for x86_64-pc-linux-gnu.

* gcc.dg/c2y-init-2.c, gcc.dg/c2y-init-3.c: New tests.
gcc/testsuite/gcc.dg/c2y-init-2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/c2y-init-3.c [new file with mode: 0644]