OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.law/] [bit-fields2.C] - Blame information for rev 779

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 305 jeremybenn
// { dg-do run  }
2
// GROUPS passed bit-fields
3
// bitfield file
4
// Message-Id: <92Oct29.191913est.62@jarvis.csri.toronto.edu>
5
// From: mdivax1!robinson@ai.mit.edu (Jim Robinson)
6
// Subject: gcc 2.2.2 C++ bug in handling :0 bit fields
7
// Date:   Thu, 29 Oct 1992 19:18:28 -0500
8
//
9
// Also applies to:
10
// bitfield file
11
// From: Jaimie Wilson/MSL 
12
// Date:   Fri, 28 Jan 1994 06:11:43 -0500
13
// Subject: GCC bug report
14
//
15
// This test is only meant for targets where EMPTY_FIELD_BOUNDARY is
16
// defined to no larger than the size of an unsigned int, or where
17
// PCC_BITFIELD_TYPE_MATTERS is defined.  Add skips below for targets that
18
// do not have that property.
19
// { dg-skip-if "" { mmix-knuth-mmixware } { "*" } { "" } }
20
 
21
 
22
#include 
23
#include 
24
 
25
struct foo {
26
        char a;
27
        char b;
28
        unsigned int : 0;       /* force word alignment */
29
        char c;
30
};
31
 
32
int
33
main(int argc, char **argv)
34
{
35
        struct foo bar;
36
 
37
        if (offsetof (struct foo, c) > sizeof (unsigned int))
38
                { printf ("FAIL\n"); return 1; }
39
        else
40
                printf ("PASS\n");
41
        return 0;
42
}
43
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.