aboutsummaryrefslogtreecommitdiff
path: root/SingleSource/Regression/C/gcc-c-torture/execute/wchar_t-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'SingleSource/Regression/C/gcc-c-torture/execute/wchar_t-1.c')
-rw-r--r--SingleSource/Regression/C/gcc-c-torture/execute/wchar_t-1.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/SingleSource/Regression/C/gcc-c-torture/execute/wchar_t-1.c b/SingleSource/Regression/C/gcc-c-torture/execute/wchar_t-1.c
new file mode 100644
index 00000000..7e90cc08
--- /dev/null
+++ b/SingleSource/Regression/C/gcc-c-torture/execute/wchar_t-1.c
@@ -0,0 +1,17 @@
+/* { dg-options "-finput-charset=utf-8" } */
+typedef __WCHAR_TYPE__ wchar_t;
+wchar_t x[] = L"Ä";
+wchar_t y = L'Ä';
+extern void abort (void);
+extern void exit (int);
+
+int main (void)
+{
+ if (sizeof (x) / sizeof (wchar_t) != 2)
+ abort ();
+ if (x[0] != L'Ä' || x[1] != L'\0')
+ abort ();
+ if (y != L'Ä')
+ abort ();
+ exit (0);
+}