// RUN: clang-cc -fsyntax-only -verify %s 
// XFAIL

char const * bad_lit1 = "\u33"; // expected-error{{incomplete universal character name}} expected-warning{{UCNs are an extension from C99}}
char const * bad_lit2 = "\U0033"; // expected-error{{incomplete universal character name}} expected-warning{{UCNs are an extension from C99}}
char const * bad_lit3 = "\uD833"; // expected-error{{invalid universal character}} expected-warning{{UCNs are an extension from C99}}
char const * bad_lit4 = "\U0000d833"; // expected-error{{invalid universal character}} expected-warning{{UCNs are an extension from C99}}

// C++0x supports a wider range of UCNs than C++98/03 or C/C99.
char const * cxx0x_lit1 = "\u0033"; // expected-error{{invalid universal character}} expected-warning{{UCNs are an extension from C99}}
char const * cxx0x_lit2 = "\u0015"; // expected-error{{invalid universal character}} expected-warning{{UCNs are an extension from C99}}
char const * cxx0x_lit3 = "\U00000033"; // expected-error{{invalid universal character}} expected-warning{{UCNs are an extension from C99}}
char const * cxx0x_lit4 = "\U00000015"; // expected-error{{invalid universal character}} expected-warning{{UCNs are an extension from C99}}

// Test the 3 valid UCNs below x7E.
char const * ucn_lit1 = "\u0024"; // expected-warning{{UCNs are an extension from C99}}
char const * ucn_lit2 = "\u0040"; // expected-warning{{UCNs are an extension from C99}}
char const * ucn_lit3 = "\u0060"; // expected-warning{{UCNs are an extension from C99}}
char const * ucn_Ulit1 = "\U00000024"; // expected-warning{{UCNs are an extension from C99}}
char const * ucn_Ulit2 = "\U00000040"; // expected-warning{{UCNs are an extension from C99}}
char const * ucn_Ulit3 = "\U00000060"; // expected-warning{{UCNs are an extension from C99}}

// char UCNs are not yet supported.
// Opening a core issue for when a UCN cannot be represented by a single char.
char const bad_char1 = '\u33'; // expected-error{{incomplete universal character name}}
char const bad_char2 = '\u0a'; // expected-error{{incomplete universal character name}}
char const bad_char3 = '\U0033'; // expected-error{{incomplete universal character name}}
char const bad_char4 = '\U000A'; // expected-error{{incomplete universal character name}}

// C++0x supports a wider range of UCNs than C++98/03 or C/C99.
char const char_lit1 = '\u0033'; // expected-error{{invalid universal character}}
char const char_lit2 = '\u000a'; // expected-error{{invalid universal character}}
char const char_lit3 = '\U00000033'; // expected-error{{invalid universal character}}
char const char_lit4 = '\U0000000A'; // expected-error{{invalid universal character}}

// Test the 3 valid UCNs below x7E.
char const ucn_char1 = '\u0024'; 
char const ucn_char2 = '\u0040';
char const ucn_char3 = '\u0060'; 
char const ucn_Uchar1 = '\U00000024'; 
char const ucn_Uchar2 = '\U00000040'; 
char const ucn_Uchar3 = '\U00000060'; 

// UCNs in identifiers are not yet supported.
// Confirm the extra character supported inside literals are not valid identifiers
int ident\u0024\u0040\u0060;  // expected-error{{invalid token after top level identifier}}
int ident\u0015; // expected-error{{invalid universal character}}
int ident\u0033; // expected-error{{invalid universal character}}
int ident\ud833; // expected-error{{invalid universal character}}

int identU\U00000024\U00000040\U00000060; // expected-error{{invalid token after top level identifier}}
int identU\U00000015; // expected-error{{invalid universal character}}
int identU\U00000033; // expected-error{{invalid universal character}}
int identU\U0000D833; // expected-error{{invalid universal character}}


// UCNs in macro identifiers are not yet supported.
// Confirm the extra character supported inside literals are not valid identifiers
#define macro\u0024\u0040\u0060; // expected-error{{invalid token after top level identifier}}
#define macro\u0015; // expected-error{{invalid universal character}}
#define macro\u0033; // expected-error{{invalid universal character}}
#define macro\uD833; // expected-error{{invalid universal character}}

#define macroU\U00000024\U00000040\U00000060; // expected-error{{invalid token after top level identifier}}
#define macroU\U00000015; // expected-error{{invalid universal character}}
#define macroU\U00000033; // expected-error{{invalid universal character}}
#define macroU\U0000d833; // expected-error{{invalid universal character}}
