← Back to davo.co
summaryrefslogtreecommitdiffstats
path: root/Unicode-test.c
blob: 5df61e3d1051ee2ce331f806c0ab1451573b6ace (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/**
 ** @file Test handling of different Unicode letters in identifiers.
 **/

#include "c23-fallback.h"

double Å = 1;                  // error, Ångström not normalized
double Å = 2;                  // ok, A with circle
double A\u030A = 3;            // error, combination not normalized
double Ω = 1;                  // error, Ohm not normalized
double Ω = 2;                  // ok, Greek capital omega
double K = 1;                  // error, Kelvin not normalized
double K = 2;
double fi  = 1;                 // valid, fi does not decompose into f and i
double fi = 2;                 // valid, different identifier
typedef double ℝ;              // valid
typedef unsigned long long ℕ;  // valid
#define ℜ(Z) real(Z)          // valid
#define ℑ(Z) imag(Z)           // valid
ℕ №;                           // error: Numero sign is not a letter
ℕ ℓ;                           // valid, ell sign is a letter
double ʃ(double a, double b, double φ(double)); // IPA is also acceptable
typedef double 각;             // valid, Hangul generally maps to itself
각 α = 1;
enum : bool { 응 = true, wɛ = true, };
char const 얜읐[] = "얜읐";
int a١ = 1;                    // valid, Arabic digits are considered different
int a1 = 2;
int a⁰ = 1;                    // non-portable, gcc and clang extension
int a𝟬 = 1;                    // valid, but not a good idea
int a0 = 2;
unsigned Ⅾ;                    // valid, roman digit 500, really a bad idea