From f685cdc1cd6baa17879b15326f553409258d3f73 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Thu, 21 Oct 2021 20:15:15 -0700 Subject: expr: Add support for UTF-8 character constants --- test/char-const-u8.c | 3 +++ test/char-const-u8.qbe | 1 + 2 files changed, 4 insertions(+) create mode 100644 test/char-const-u8.c create mode 100644 test/char-const-u8.qbe (limited to 'test') diff --git a/test/char-const-u8.c b/test/char-const-u8.c new file mode 100644 index 0000000..9f20452 --- /dev/null +++ b/test/char-const-u8.c @@ -0,0 +1,3 @@ +unsigned char u8 = u8'a'; +_Static_assert(__builtin_types_compatible_p(__typeof__(u8'b'), unsigned char), + "UTF-8 character constant has incorrect type"); diff --git a/test/char-const-u8.qbe b/test/char-const-u8.qbe new file mode 100644 index 0000000..2d199a4 --- /dev/null +++ b/test/char-const-u8.qbe @@ -0,0 +1 @@ +export data $u8 = align 1 { b 97, } -- cgit v1.2.3