blob: b672b15360a20c55530854598dc4800a512e5ba1 [file] [log] [blame]
Eric Christopheracc060f2011-07-26 23:56:49 +00001// RUN: %clang_cc1 -emit-llvm %s -o - -triple i386-pc-win32 | FileCheck %s --check-prefix=WIN
2// RUN: %clang_cc1 -emit-llvm %s -o - -triple x86_64-apple-darwin | FileCheck %s --check-prefix=DAR
Eric Christopherfd015a52011-07-26 18:39:16 +00003// This should pass for any endianness combination of host and target.
4
5// This bit is taken from Sema/wchar.c so we can avoid the wchar.h include.
6typedef __WCHAR_TYPE__ wchar_t;
7#if defined(_WIN32) || defined(_M_IX86) || defined(__CYGWIN__) \
8 || defined(_M_X64) || defined(SHORT_WCHAR)
9 #define WCHAR_T_TYPE unsigned short
10#elif defined(__sun) || defined(__AuroraUX__)
11 #define WCHAR_T_TYPE long
12#else /* Solaris or AuroraUX. */
13 #define WCHAR_T_TYPE int
14#endif
15
16
Eric Christopheracc060f2011-07-26 23:56:49 +000017// CHECK-DAR: private unnamed_addr constant [72 x i8] c"
18// CHECK-WIN: private unnamed_addr constant [36 x i8] c"
Eric Christopherfd015a52011-07-26 18:39:16 +000019extern void foo(const wchar_t* p);
20int main (int argc, const char * argv[])
21{
22 foo(L"This is some text");
23 return 0;
24}