blob: 3e6a16579c8e7371e9f788be7f39071aba04e100 [file] [log] [blame]
Reid Kleckner736bc982013-07-17 20:46:03 +00001// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts -fsyntax-only -mms-bitfields -verify %s 2>&1
2
3struct A {
Rachel Craik022bdc7d2015-09-14 21:27:36 +00004 char a : 9; // expected-error{{width of bit-field 'a' (9 bits) exceeds width of its type (8 bits)}}
5 int b : 33; // expected-error{{width of bit-field 'b' (33 bits) exceeds width of its type (32 bits)}}
David Majnemerd558aa82015-09-15 01:00:55 +00006 bool c : 9; // expected-error{{width of bit-field 'c' (9 bits) exceeds width of its type (8 bits)}}
David Majnemer1cbe8042015-09-15 02:36:41 +00007 bool d : 3; // expected-warning{{width of bit-field 'd' (3 bits) exceeds the width of its type; value will be truncated to 1 bit}}
Reid Kleckner736bc982013-07-17 20:46:03 +00008};
9
10int a[sizeof(A) == 1 ? 1 : -1];