blob: 12d47205e87de2c983eee7b4ad5fae0c9a02644b [file] [log] [blame]
Eli Friedman04e83572009-08-20 04:21:42 +00001// RUN: clang-cc -fsyntax-only -verify %s -triple pic16-unknown-unknown
2
3// Check that int-sized unsigned bit-fields promote to unsigned int
4// on targets where sizeof(unsigned short) == sizeof(unsigned int)
5
6enum E { ec1, ec2, ec3 };
7struct S {
8 enum E e : 16;
9 unsigned short us : 16;
10 unsigned long ul1 : 8;
11 unsigned long ul2 : 16;
12} s;
13
14__typeof(s.e + s.e) x_e;
15unsigned x_e;
16
17__typeof(s.us + s.us) x_us;
18unsigned x_us;
19
20__typeof(s.ul1 + s.ul1) x_ul1;
21signed x_ul1;
22
23__typeof(s.ul2 + s.ul2) x_ul2;
24unsigned x_ul2;
25