• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 struct {unsigned x : 2;} x;
3 __typeof__((x.x+=1)+1) y;
4 __typeof__(x.x<<1) y;
5 int y;
6 
7 
8 struct { int x : 8; } x1;
9 long long y1;
10 __typeof__(((long long)x1.x + 1)) y1;
11 
12 
13 // Check for extensions: variously sized unsigned bit-fields fitting
14 // into a signed int promote to signed int.
15 enum E { ec1, ec2, ec3 };
16 struct S {
17   enum E          e : 2;
18   unsigned short us : 4;
19   unsigned long long ul1 : 8;
20   unsigned long long ul2 : 50;
21 } s;
22 
23 __typeof(s.e + s.e) x_e;
24 int x_e;
25 
26 __typeof(s.us + s.us) x_us;
27 int x_us;
28 
29 __typeof(s.ul1 + s.ul1) x_ul1;
30 int x_ul1;
31 
32 __typeof(s.ul2 + s.ul2) x_ul2;
33 unsigned long long x_ul2;
34 
35