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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [volatile-bitfields-1.c] - Blame information for rev 774

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

Line No. Rev Author Line
1 689 jeremybenn
/* { dg-options "-fstrict-volatile-bitfields" } */
2
/* { dg-do run } */
3
 
4
extern int puts(const char *);
5
extern void abort(void) __attribute__((noreturn));
6
 
7
typedef struct {
8
  volatile unsigned short a:8, b:8;
9
} BitStruct;
10
 
11
BitStruct bits = {1, 2};
12
 
13
void check(int i, int j)
14
{
15
  if (i != 1 || j != 2) puts("FAIL"), abort();
16
}
17
 
18
int main ()
19
{
20
  check(bits.a, bits.b);
21
 
22
  return 0;
23
}

powered by: WebSVN 2.1.0

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