]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.dg/c2x-constexpr-5.c
testsuite: Refer more consistently to C23 not C2X
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / c2x-constexpr-5.c
1 /* Test C23 constexpr. Valid code, compilation tests, unsigned char. */
2 /* { dg-do compile } */
3 /* { dg-options "-std=c23 -pedantic-errors -funsigned-char" } */
4
5 constexpr char v1[] = "\x00\xff";
6 constexpr signed char v2[] = "\x7f\x00";
7 constexpr unsigned char v3[] = "\x80\x7f";
8 constexpr char v4[] = u8"\x00\xff";
9 constexpr signed char v5[] = u8"\x7f\x00";
10 constexpr unsigned char v6[] = u8"\x00\xff";
11
12 void
13 f0 ()
14 {
15 (constexpr char []) { "\x00\xff" };
16 (constexpr signed char []) { "\x7f\x00" };
17 (constexpr unsigned char []) { "\x80\x7f" };
18 (constexpr char []) { u8"\x00\xff" };
19 (constexpr signed char []) { u8"\x7f\x00" };
20 (constexpr unsigned char []) { u8"\x00\xff" };
21 }