1 typedef unsigned short          u16;
   2 typedef unsigned int            u32;
   3 
   4 union u {
   5         u32     a;
   6         u16     b;
   7 };
   8 
   9 struct s {
  10         u32     a;
  11         u16     b;
  12 };
  13 
  14 
  15 void bar(u16, u32);
  16 void union_to_int(u16 val);
  17 void struct_to_int(u16 val);
  18 
  19 
  20 void union_to_int(u16 val)
  21 {
  22         union u u;
  23 
  24         u.b = val;
  25         bar(u.b, u);
  26 }
  27 
  28 void struct_to_int(u16 val)
  29 {
  30         struct s s;
  31 
  32         s.b = val;
  33         bar(s.b, s);
  34 }
  35 
  36 /*
  37  * check-name: cast-bad 00
  38  *
  39  * check-error-start
  40 cast-bad-00.c:25:18: warning: incorrect type in argument 2 (different base types)
  41 cast-bad-00.c:25:18:    expected unsigned int [usertype]
  42 cast-bad-00.c:25:18:    got union u [assigned] u
  43 cast-bad-00.c:33:18: warning: incorrect type in argument 2 (different base types)
  44 cast-bad-00.c:33:18:    expected unsigned int [usertype]
  45 cast-bad-00.c:33:18:    got struct s [assigned] s
  46  * check-error-end
  47  */