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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [bitfld-2.c] - Blame information for rev 688

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 688 jeremybenn
/* Test whether bit field boundaries aren't advanced if bit field type
2
   has alignment large enough.  */
3
extern void abort (void);
4
extern void exit (int);
5
 
6
struct A {
7
  unsigned short a : 5;
8
  unsigned short b : 5;
9
  unsigned short c : 6;
10
};
11
 
12
struct B {
13
  unsigned short a : 5;
14
  unsigned short b : 3;
15
  unsigned short c : 8;
16
};
17
 
18
int main ()
19
{
20
  /* If short is not at least 16 bits wide, don't test anything.  */
21
  if ((unsigned short) 65521 != 65521)
22
    exit (0);
23
 
24
  if (sizeof (struct A) != sizeof (struct B))
25
    abort ();
26
 
27
  exit (0);
28
}

powered by: WebSVN 2.1.0

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