blob: a9e7e523f96d356263b725932024fe8040adaa83 [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
Eli Friedman64f45a22011-11-01 02:23:42 +000017// CHECK-DAR: private unnamed_addr constant [18 x i32] [i32 84,
18// CHECK-WIN: private unnamed_addr constant [18 x i16] [i16 84,
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}