Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / Sema / bitfield-promote.c
blob3189cd57e4f363690ff92ade0b894edd3bc3aed0
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 // expected-no-diagnostics
3 struct {unsigned x : 2;} x;
4 __typeof__((x.x+=1)+1) y;
5 __typeof__(x.x<<1) y;
6 int y;
9 struct { int x : 8; } x1;
10 long long y1;
11 __typeof__(((long long)x1.x + 1)) y1;
14 // Check for extensions: variously sized unsigned bit-fields fitting
15 // into a signed int promote to signed int.
16 enum E { ec1, ec2, ec3 };
17 struct S {
18 enum E e : 2;
19 unsigned short us : 4;
20 unsigned long long ul1 : 8;
21 unsigned long long ul2 : 50;
22 } s;
24 __typeof(s.e + s.e) x_e;
25 int x_e;
27 __typeof(s.us + s.us) x_us;
28 int x_us;
30 __typeof(s.ul1 + s.ul1) x_ul1;
31 int x_ul1;
33 __typeof(s.ul2 + s.ul2) x_ul2;
34 unsigned long long x_ul2;