annotate clang/test/Lexer/utf8-char-literal.cpp @ 207:2e18cbf3894f

LLVM12
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 08 Jun 2021 06:07:14 +0900
parents 1d019706d866
children c4bab56944e8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c++11 -fsyntax-only -verify %s
anatofuz
parents:
diff changeset
2 // RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c11 -x c -fsyntax-only -verify %s
anatofuz
parents:
diff changeset
3 // RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c++1z -fsyntax-only -verify %s
anatofuz
parents:
diff changeset
4
anatofuz
parents:
diff changeset
5 int array0[u'ñ' == u'\xf1'? 1 : -1];
anatofuz
parents:
diff changeset
6 int array1['\xF1' != u'\xf1'? 1 : -1];
anatofuz
parents:
diff changeset
7 int array1['ñ' != u'\xf1'? 1 : -1]; // expected-error {{character too large for enclosing character literal type}}
anatofuz
parents:
diff changeset
8 #if __cplusplus > 201402L
anatofuz
parents:
diff changeset
9 char a = u8'ñ'; // expected-error {{character too large for enclosing character literal type}}
anatofuz
parents:
diff changeset
10 char b = u8'\x80'; // ok
anatofuz
parents:
diff changeset
11 char c = u8'\u0080'; // expected-error {{character too large for enclosing character literal type}}
anatofuz
parents:
diff changeset
12 char d = u8'\u1234'; // expected-error {{character too large for enclosing character literal type}}
anatofuz
parents:
diff changeset
13 char e = u8'ሴ'; // expected-error {{character too large for enclosing character literal type}}
anatofuz
parents:
diff changeset
14 char f = u8'ab'; // expected-error {{Unicode character literals may not contain multiple characters}}
anatofuz
parents:
diff changeset
15 #endif