unicode.c 805 B

1234567891011121314151617181920212223242526
  1. // RUN: %clang_cc1 -fsyntax-only -verify %s
  2. // RUN: %clang_cc1 -E -DPP_ONLY=1 %s -o %t
  3. // RUN: FileCheck --strict-whitespace --input-file=%t %s
  4. // This file contains Unicode characters; please do not "fix" them!
  5. extern int x; // expected-warning {{treating Unicode character as whitespace}}
  6. extern int x; // expected-warning {{treating Unicode character as whitespace}}
  7. // CHECK: extern int {{x}}
  8. // CHECK: extern int {{x}}
  9. #pragma mark ¡Unicode!
  10. #define COPYRIGHT Copyright © 2012
  11. #define XSTR(X) #X
  12. #define STR(X) XSTR(X)
  13. static const char *copyright = STR(COPYRIGHT); // no-warning
  14. // CHECK: static const char *copyright = "Copyright © {{2012}}";
  15. #if PP_ONLY
  16. COPYRIGHT
  17. // CHECK: Copyright © {{2012}}
  18. CHECK: The preprocessor should not complain about Unicode characters like ©.
  19. #endif