Steve Naroff | 0e3e3eb | 2009-03-30 23:46:03 +0000 | [diff] [blame] | 1 | // RUN: clang-cc %s -verify -fsyntax-only -pedantic |
| 2 | |
Daniel Dunbar | 23afaad | 2009-11-17 08:57:36 +0000 | [diff] [blame^] | 3 | int printf(const char *, ...); |
Steve Naroff | 0e3e3eb | 2009-03-30 23:46:03 +0000 | [diff] [blame] | 4 | |
| 5 | int main(void) { |
Steve Naroff | 8a5c0cd | 2009-03-31 10:29:45 +0000 | [diff] [blame] | 6 | int a[sizeof("hello \u2192 \u2603 \u2190 world") == 24 ? 1 : -1]; |
| 7 | |
Steve Naroff | 0e3e3eb | 2009-03-30 23:46:03 +0000 | [diff] [blame] | 8 | 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 | |