libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / c23-constexpr-5.c
blob5899ca1b11e32b1395cee59fa06e57f5e9837f41
1 /* Test C23 constexpr. Valid code, compilation tests, unsigned char. */
2 /* { dg-do compile } */
3 /* { dg-options "-std=c23 -pedantic-errors -funsigned-char" } */
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";
12 void
13 f0 ()
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" };