Eric Christopher | acc060f | 2011-07-26 23:56:49 +0000 | [diff] [blame] | 1 | // 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 Christopher | fd015a5 | 2011-07-26 18:39:16 +0000 | [diff] [blame] | 3 | // 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. |
| 6 | typedef __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 Friedman | 64f45a2 | 2011-11-01 02:23:42 +0000 | [diff] [blame] | 17 | // CHECK-DAR: private unnamed_addr constant [18 x i32] [i32 84, |
| 18 | // CHECK-WIN: private unnamed_addr constant [18 x i16] [i16 84, |
Eric Christopher | fd015a5 | 2011-07-26 18:39:16 +0000 | [diff] [blame] | 19 | extern void foo(const wchar_t* p); |
| 20 | int main (int argc, const char * argv[]) |
| 21 | { |
| 22 | foo(L"This is some text"); |
| 23 | return 0; |
| 24 | } |