xref: /minix3/external/bsd/llvm/dist/clang/test/Lexer/unicode.c (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -fsyntax-only -verify %s
2*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -E -DPP_ONLY=1 %s -o %t
3*f4a2713aSLionel Sambuc // RUN: FileCheck --strict-whitespace --input-file=%t %s
4*f4a2713aSLionel Sambuc 
5*f4a2713aSLionel Sambuc // This file contains Unicode characters; please do not "fix" them!
6*f4a2713aSLionel Sambuc 
7*f4a2713aSLionel Sambuc extern int x; // expected-warning {{treating Unicode character as whitespace}}
8*f4a2713aSLionel Sambuc extern int x; // expected-warning {{treating Unicode character as whitespace}}
9*f4a2713aSLionel Sambuc 
10*f4a2713aSLionel Sambuc // CHECK: extern int {{x}}
11*f4a2713aSLionel Sambuc // CHECK: extern int {{x}}
12*f4a2713aSLionel Sambuc 
13*f4a2713aSLionel Sambuc #pragma mark ¡Unicode!
14*f4a2713aSLionel Sambuc 
15*f4a2713aSLionel Sambuc #define COPYRIGHT Copyright © 2012
16*f4a2713aSLionel Sambuc #define XSTR(X) #X
17*f4a2713aSLionel Sambuc #define STR(X) XSTR(X)
18*f4a2713aSLionel Sambuc 
19*f4a2713aSLionel Sambuc static const char *copyright = STR(COPYRIGHT); // no-warning
20*f4a2713aSLionel Sambuc // CHECK: static const char *copyright = "Copyright © {{2012}}";
21*f4a2713aSLionel Sambuc 
22*f4a2713aSLionel Sambuc #if PP_ONLY
23*f4a2713aSLionel Sambuc COPYRIGHT
24*f4a2713aSLionel Sambuc // CHECK: Copyright © {{2012}}
25*f4a2713aSLionel Sambuc CHECK: The preprocessor should not complain about Unicode characters like ©.
26*f4a2713aSLionel Sambuc #endif
27