aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/c2x-constexpr-4.c
blob: 2a42af890a2a87804aa7460ec2bf725dc9501ffd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* Test C2x constexpr.  Valid code, compilation tests, signed char.  */
/* { dg-do compile } */
/* { dg-options "-std=c2x -pedantic-errors -fsigned-char" } */

constexpr char v1[] = "\x00\xff";
constexpr signed char v2[] = "\x7f\x80";
constexpr unsigned char v3[] = "\x00\x7f";
constexpr char v4[] = u8"\x00\x7f";
constexpr signed char v5[] = u8"\x7f\x00";
constexpr unsigned char v6[] = u8"\x00\xff";

void
f0 ()
{
  (constexpr char []) { "\x00\xff" };
  (constexpr signed char []) { "\x7f\x80" };
  (constexpr unsigned char []) { "\x00\x7f" };
  (constexpr char []) { u8"\x00\x7f" };
  (constexpr signed char []) { u8"\x7f\x00" };
  (constexpr unsigned char []) { u8"\x00\xff" };
}