Eli Friedman | 04e8357 | 2009-08-20 04:21:42 +0000 | [diff] [blame] | 1 | // 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 | |
| 6 | enum E { ec1, ec2, ec3 }; |
| 7 | struct 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; |
| 15 | unsigned x_e; |
| 16 | |
| 17 | __typeof(s.us + s.us) x_us; |
| 18 | unsigned x_us; |
| 19 | |
| 20 | __typeof(s.ul1 + s.ul1) x_ul1; |
| 21 | signed x_ul1; |
| 22 | |
| 23 | __typeof(s.ul2 + s.ul2) x_ul2; |
| 24 | unsigned x_ul2; |
| 25 | |