aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/c23-constexpr-5.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/c23-constexpr-5.c')
-rw-r--r--gcc/testsuite/gcc.dg/c23-constexpr-5.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/c23-constexpr-5.c b/gcc/testsuite/gcc.dg/c23-constexpr-5.c
new file mode 100644
index 0000000..5899ca1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/c23-constexpr-5.c
@@ -0,0 +1,21 @@
+/* Test C23 constexpr. Valid code, compilation tests, unsigned char. */
+/* { dg-do compile } */
+/* { dg-options "-std=c23 -pedantic-errors -funsigned-char" } */
+
+constexpr char v1[] = "\x00\xff";
+constexpr signed char v2[] = "\x7f\x00";
+constexpr unsigned char v3[] = "\x80\x7f";
+constexpr char v4[] = u8"\x00\xff";
+constexpr signed char v5[] = u8"\x7f\x00";
+constexpr unsigned char v6[] = u8"\x00\xff";
+
+void
+f0 ()
+{
+ (constexpr char []) { "\x00\xff" };
+ (constexpr signed char []) { "\x7f\x00" };
+ (constexpr unsigned char []) { "\x80\x7f" };
+ (constexpr char []) { u8"\x00\xff" };
+ (constexpr signed char []) { u8"\x7f\x00" };
+ (constexpr unsigned char []) { u8"\x00\xff" };
+}