diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-09-27 17:00:18 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-09-27 17:00:18 +0000 |
commit | 17c8c84fbc5cbde336fdef8fffe63c08a955ade9 (patch) | |
tree | e29df19b73c24b682fd2dc139ed22f0041b07f18 /test/Lexer/utf8-char-literal.cpp | |
parent | c737acb8e86564becc5939d681089d1851e6be1a (diff) |
When parsing a character literal, extract the characters from the
buffer as an 'unsigned char', so that integer promotion doesn't
sign-extend character values > 127 into oblivion. Fixes
<rdar://problem/10188919>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140608 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Lexer/utf8-char-literal.cpp')
-rw-r--r-- | test/Lexer/utf8-char-literal.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/Lexer/utf8-char-literal.cpp b/test/Lexer/utf8-char-literal.cpp new file mode 100644 index 0000000000..1dbd669cfd --- /dev/null +++ b/test/Lexer/utf8-char-literal.cpp @@ -0,0 +1,4 @@ +// RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c++0x -fsyntax-only -verify %s + +int array0[u'ñ' == u'\xf1'? 1 : -1]; +int array1['ñ' != u'\xf1'? 1 : -1]; |