Eric Christopher | fd015a5 | 2011-07-26 18:39:16 +0000 | [diff] [blame^] | 1 | // RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s |
| 2 | // This should pass for any endianness combination of host and target. |
| 3 | |
| 4 | // This bit is taken from Sema/wchar.c so we can avoid the wchar.h include. |
| 5 | typedef __WCHAR_TYPE__ wchar_t; |
| 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 | |
| 15 | |
| 16 | // CHECK: @.str = private unnamed_addr constant [72 x i8] c" |
| 17 | extern void foo(const wchar_t* p); |
| 18 | int main (int argc, const char * argv[]) |
| 19 | { |
| 20 | foo(L"This is some text"); |
| 21 | return 0; |
| 22 | } |