1 typedef _Bool bool;
   2 typedef unsigned char uchar;
   3 typedef unsigned short ushort;
   4 typedef unsigned int uint;
   5 typedef unsigned long ulong;
   6 typedef long long longlong;
   7 typedef unsigned long long ulonglong;
   8 
   9 #define DEFINE_CAST(from, to)                   \
  10         static to from##2##to(from x) {         \
  11                 return x;                       \
  12         }
  13 
  14 #define DEFINE_CASTS(from)                      \
  15         DEFINE_CAST(from, bool)                 \
  16         DEFINE_CAST(from, char)                 \
  17         DEFINE_CAST(from, uchar)                \
  18         DEFINE_CAST(from, short)                \
  19         DEFINE_CAST(from, ushort)               \
  20         DEFINE_CAST(from, int)                  \
  21         DEFINE_CAST(from, uint)                 \
  22         DEFINE_CAST(from, long)                 \
  23         DEFINE_CAST(from, ulong)                \
  24         DEFINE_CAST(from, longlong)             \
  25         DEFINE_CAST(from, ulonglong)            \
  26 /*
  27         DEFINE_CAST(from, float)                \
  28         DEFINE_CAST(from, double)
  29 */
  30 
  31 DEFINE_CASTS(bool)
  32 DEFINE_CASTS(char)
  33 DEFINE_CASTS(uchar)
  34 DEFINE_CASTS(short)
  35 DEFINE_CASTS(ushort)
  36 DEFINE_CASTS(int)
  37 DEFINE_CASTS(uint)
  38 DEFINE_CASTS(long)
  39 DEFINE_CASTS(ulong)
  40 DEFINE_CASTS(longlong)
  41 DEFINE_CASTS(ulonglong)
  42 /*
  43 DEFINE_CASTS(float)
  44 DEFINE_CASTS(double)
  45 */
  46 
  47 /*
  48  * check-name: Cast code generation
  49  * check-command: sparsec -c $file -o tmp.o
  50  */