summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/bitfld-10.c
diff options
context:
space:
mode:
authorjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2004-11-06 20:01:42 +0000
committerjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2004-11-06 20:01:42 +0000
commita11ed85ba193b8200c95d0844c6c38d0b591ec43 (patch)
tree40638c5100c3123ac12f7abb6ca26a129f09a2ce /gcc/testsuite/gcc.dg/bitfld-10.c
parent3c03905c932905a7143ec914064abe6f112dfc3a (diff)
downloadgcc-a11ed85ba193b8200c95d0844c6c38d0b591ec43.tar.gz
* gcc.dg/anon-struct-6.c, gcc.dg/anon-struct-7.c,
gcc.dg/anon-struct-8.c, gcc.dg/bitfld-10.c, gcc.dg/bitfld-11.c, gcc.dg/bitfld-12.c, gcc.dg/func-outside-1.c, gcc.dg/func-outside-2.c, gcc.dg/label-decl-1.c, gcc.dg/label-decl-2.c, gcc.dg/label-decl-3.c, gcc.dg/label-decl-4.c, gcc.dg/struct-empty-1.c, gcc.dg/struct-empty-2.c, gcc.dg/struct-empty-3.c, gcc.dg/struct-semi-1.c, gcc.dg/struct-semi-2.c, gcc.dg/struct-semi-3.c: New tests. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@90193 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/bitfld-10.c')
-rw-r--r--gcc/testsuite/gcc.dg/bitfld-10.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/bitfld-10.c b/gcc/testsuite/gcc.dg/bitfld-10.c
new file mode 100644
index 00000000000..156929f49fd
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/bitfld-10.c
@@ -0,0 +1,8 @@
+/* Test for rejection of sizeof on bit-fields. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+struct { int a : 1; } x;
+
+int r = sizeof (x.a); /* { dg-error "error: 'sizeof' applied to a bit-field" } */