[Heikki Kultala] This patch contains the ABI changes for the TCE target.
[clang.git] / test / CodeGen / char-literal.c
blobaff76d280d3068201183327760b26c41fe576aee
1 // RUN: %clang_cc1 -x c++ -triple i386-unknown-unkown -emit-llvm %s -o - | FileCheck %s
2 // Runs in c++ mode so that wchar_t is available.
4 int main() {
5 // CHECK: store i8 97
6 char a = 'a';
8 // Should pick second character.
9 // CHECK: store i8 98
10 char b = 'ab';
12 // CHECK: store i32 97
13 wchar_t wa = L'a';
15 // Should pick second character.
16 // CHECK: store i32 98
17 wchar_t wb = L'ab';
19 // Should pick last character and store its lowest byte.
20 // This does not match gcc, which takes the last character, converts it to
21 // utf8, and then picks the second-lowest byte of that (they probably store
22 // the utf8 in uint16_ts internally and take the lower byte of that).
23 // CHECK: store i8 48
24 char c = '\u1120\u0220\U00102030';
26 // CHECK: store i32 61451
27 wchar_t wc = L'\uF00B';
29 // CHECK: store i32 1110027
30 wchar_t wd = L'\U0010F00B';
32 // Should pick second character.
33 // CHECK: store i32 1110027
34 wchar_t we = L'\u1234\U0010F00B';