From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- clang/test/Lexer/char-literal.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 clang/test/Lexer/char-literal.cpp (limited to 'clang/test/Lexer/char-literal.cpp') diff --git a/clang/test/Lexer/char-literal.cpp b/clang/test/Lexer/char-literal.cpp new file mode 100644 index 0000000..5dc5360 --- /dev/null +++ b/clang/test/Lexer/char-literal.cpp @@ -0,0 +1,24 @@ +// RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c++11 -Wfour-char-constants -fsyntax-only -verify %s + +int a = 'ab'; // expected-warning {{multi-character character constant}} +int b = '\xFF\xFF'; // expected-warning {{multi-character character constant}} +int c = 'APPS'; // expected-warning {{multi-character character constant}} + +char d = '⌘'; // expected-error {{character too large for enclosing character literal type}} +char e = '\u2318'; // expected-error {{character too large for enclosing character literal type}} + +auto f = '\xE2\x8C\x98'; // expected-warning {{multi-character character constant}} + +char16_t g = u'ab'; // expected-error {{Unicode character literals may not contain multiple characters}} +char16_t h = u'\U0010FFFD'; // expected-error {{character too large for enclosing character literal type}} + +wchar_t i = L'ab'; // expected-warning {{extraneous characters in character constant ignored}} +wchar_t j = L'\U0010FFFD'; + +char32_t k = U'\U0010FFFD'; + +char l = 'Ø'; // expected-error {{character too large for enclosing character literal type}} +char m = '👿'; // expected-error {{character too large for enclosing character literal type}} + +char32_t n = U'ab'; // expected-error {{Unicode character literals may not contain multiple characters}} +char16_t o = '👽'; // expected-error {{character too large for enclosing character literal type}} -- cgit v1.2.3