blob: fb9a3b604eb743bc9f25b29880ee18e90913ce2d [file] [log] [blame]
Steve Naroff0e3e3eb2009-03-30 23:46:03 +00001// RUN: clang-cc %s -verify -fsyntax-only -pedantic
2
Daniel Dunbar23afaad2009-11-17 08:57:36 +00003int printf(const char *, ...);
Steve Naroff0e3e3eb2009-03-30 23:46:03 +00004
5int main(void) {
Steve Naroff8a5c0cd2009-03-31 10:29:45 +00006 int a[sizeof("hello \u2192 \u2603 \u2190 world") == 24 ? 1 : -1];
7
Steve Naroff0e3e3eb2009-03-30 23:46:03 +00008 printf("%s (%d)\n", "hello \u2192 \u2603 \u2190 world", sizeof("hello \u2192 \u2603 \u2190 world"));
9 printf("%s (%d)\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{{invalid universal character}}
15 return 0;
16}
17