brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.9 KiB · 16126fd Raw
81 lines · c
1// RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -check-prefix=CHECK-C %s2// RUN: %clang_cc1 -x c++ -std=c++11 -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -check-prefix=CHECK-CPP0X %s3 4#include <stddef.h>5 6int main(void) {7  // CHECK-C: store i8 978  // CHECK-CPP0X: store i8 979  char a = 'a';10 11  // Should truncate value (equal to last character).12  // CHECK-C: store i8 9813  // CHECK-CPP0X: store i8 9814  char b = 'ab';15 16  // Should get concatenated characters17  // CHECK-C: store i32 2493018  // CHECK-CPP0X: store i32 2493019  int b1 = 'ab';20 21  // Should get concatenated characters22  // CHECK-C: store i32 80846443223  // CHECK-CPP0X: store i32 80846443224  int b2 = '0000';25 26  // Should get truncated value (last four characters concatenated)27  // CHECK-C: store i32 191951216728  // CHECK-CPP0X: store i32 191951216729  int b3 = 'somesillylongstring';30 31  // CHECK-C: store i32 9732  // CHECK-CPP0X: store i32 9733  wchar_t wa = L'a';34 35#if __cplusplus >= 201103L36  // CHECK-CPP0X: store i16 9737  char16_t ua = u'a';38 39  // CHECK-CPP0X: store i32 9740  char32_t Ua = U'a';41 42  // CHECK-CPP0X: store i16 104743  char16_t ua1 = u'З';44  // CHECK-CPP0X: store i16 1253845  char16_t ua2 = u'ヺ';46  // CHECK-CPP0X: store i16 -2717747  char16_t ua3 = u'闗';48 49  // CHECK-CPP0X: store i32 18150  char32_t Ua1 = U'µ';51  // CHECK-CPP0X: store i32 3835952  char32_t Ua2 = U'闗';53  // CHECK-CPP0X: store i32 12812854  char32_t Ua3 = U'💀';55 56#endif57 58  // CHECK-C: store i32 6145159  // CHECK-CPP0X: store i32 6145160  wchar_t wc = L'\uF00B';61 62#if __cplusplus >= 201103L63  // -4085 == 0xf00b64  // CHECK-CPP0X: store i16 -408565  char16_t uc = u'\uF00B';66 67  // CHECK-CPP0X: store i32 6145168  char32_t Uc = U'\uF00B';69#endif70 71  // CHECK-C: store i32 111002772  // CHECK-CPP0X: store i32 111002773  wchar_t wd = L'\U0010F00B';74 75#if __cplusplus >= 201103L76  // CHECK-CPP0X: store i32 111002777  char32_t Ud = U'\U0010F00B';78#endif79 80}81