Home | History | Annotate | Download | only in Sema
      1 // RUN: %clang_cc1 %s -verify -fsyntax-only -pedantic
      2 
      3 int printf(const char *, ...);
      4 
      5 int main(void) {
      6   int a[sizeof("hello \u2192 \u2603 \u2190 world") == 24 ? 1 : -1];
      7 
      8   printf("%s (%zd)\n", "hello \u2192 \u2603 \u2190 world", sizeof("hello \u2192 \u2603 \u2190 world"));
      9   printf("%s (%zd)\n", "\U00010400\U0001D12B", sizeof("\U00010400\U0001D12B"));
     10   // Some error conditions...
     11   printf("%s\n", "\U"); // expected-error{{\U used with no following hex digits}}
     12   printf("%s\n", "\U00"); // expected-error{{incomplete universal character name}}
     13   printf("%s\n", "\U0001"); // expected-error{{incomplete universal character name}}
     14   printf("%s\n", "\u0001"); // expected-error{{universal character name refers to a control character}}
     15   return 0;
     16 }
     17