annotate clang/test/CodeGen/wchar-const.c @ 207:2e18cbf3894f

LLVM12
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 08 Jun 2021 06:07:14 +0900
parents 1d019706d866
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_cc1 -emit-llvm %s -o - -triple i386-pc-win32 | FileCheck %s --check-prefix=CHECK-WIN
anatofuz
parents:
diff changeset
2 // RUN: %clang_cc1 -emit-llvm %s -o - -triple x86_64-apple-darwin | FileCheck %s --check-prefix=CHECK-DAR
anatofuz
parents:
diff changeset
3 // This should pass for any endianness combination of host and target.
anatofuz
parents:
diff changeset
4
anatofuz
parents:
diff changeset
5 // This bit is taken from Sema/wchar.c so we can avoid the wchar.h include.
anatofuz
parents:
diff changeset
6 typedef __WCHAR_TYPE__ wchar_t;
anatofuz
parents:
diff changeset
7 #if defined(_WIN32) || defined(_M_IX86) || defined(__CYGWIN__) \
anatofuz
parents:
diff changeset
8 || defined(_M_X64) || defined(SHORT_WCHAR)
anatofuz
parents:
diff changeset
9 #define WCHAR_T_TYPE unsigned short
anatofuz
parents:
diff changeset
10 #elif defined(__sun)
anatofuz
parents:
diff changeset
11 #define WCHAR_T_TYPE long
anatofuz
parents:
diff changeset
12 #else /* Solaris. */
anatofuz
parents:
diff changeset
13 #define WCHAR_T_TYPE int
anatofuz
parents:
diff changeset
14 #endif
anatofuz
parents:
diff changeset
15
anatofuz
parents:
diff changeset
16
anatofuz
parents:
diff changeset
17 // CHECK-DAR: private unnamed_addr constant [18 x i32] [i32 84,
anatofuz
parents:
diff changeset
18 // CHECK-WIN: linkonce_odr dso_local unnamed_addr constant [18 x i16] [i16 84,
anatofuz
parents:
diff changeset
19 extern void foo(const wchar_t* p);
anatofuz
parents:
diff changeset
20 int main (int argc, const char * argv[])
anatofuz
parents:
diff changeset
21 {
anatofuz
parents:
diff changeset
22 foo(L"This is some text");
anatofuz
parents:
diff changeset
23 return 0;
anatofuz
parents:
diff changeset
24 }