blob: cd9adcffc07120b261383ccd091a0a4278826bb5 [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s -triple pic16-unknown-unknown
Eli Friedman04e83572009-08-20 04:21:42 +00002
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