blob: 28ec2f14ceb79945a8d4efd5eadd945e47c0111d [file] [log] [blame]
Shih-wei Liaof8fd82b2010-02-10 11:10:31 -08001// RUN: %clang %s -fsyntax-only -Xclang -verify
2// RUN: %clang %s -fsyntax-only -fshort-wchar -Xclang -verify -DSHORT_WCHAR
3
4typedef __WCHAR_TYPE__ wchar_t;
5
6#if defined(_WIN32) || defined(_M_IX86) || defined(__CYGWIN__) \
7 || defined(_M_X64) || defined(SHORT_WCHAR)
8 #define WCHAR_T_TYPE unsigned short
9#elif defined(__sun) || defined(__AuroraUX__)
10 #define WCHAR_T_TYPE long
11#else /* Solaris or AuroraUX. */
12 #define WCHAR_T_TYPE int
13#endif
14
15int check_wchar_size[sizeof(*L"") == sizeof(wchar_t) ? 1 : -1];
16
17void foo() {
18 WCHAR_T_TYPE t1[] = L"x";
19 wchar_t tab[] = L"x";
20 WCHAR_T_TYPE t2[] = "x"; // expected-error {{initializer}}
21 char t3[] = L"x"; // expected-error {{initializer}}
22}