aboutsummaryrefslogtreecommitdiff
path: root/test/Sema/bitfield-promote-int-16bit.c
blob: 12d47205e87de2c983eee7b4ad5fae0c9a02644b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// RUN: clang-cc -fsyntax-only -verify %s -triple pic16-unknown-unknown

// Check that int-sized unsigned bit-fields promote to unsigned int
// on targets where sizeof(unsigned short) == sizeof(unsigned int)

enum E { ec1, ec2, ec3 };
struct S {
  enum E          e : 16;
  unsigned short us : 16;
  unsigned long ul1 :  8;
  unsigned long ul2 : 16;
} s;

__typeof(s.e + s.e) x_e;
unsigned x_e;

__typeof(s.us + s.us) x_us;
unsigned x_us;

__typeof(s.ul1 + s.ul1) x_ul1;
signed x_ul1;

__typeof(s.ul2 + s.ul2) x_ul2;
unsigned x_ul2;