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/] [gcc.c-torture/] [execute/] [20090527-1.c] - Blame information for rev 338

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 297 jeremybenn
typedef enum { POSITION_ASIS, POSITION_UNSPECIFIED } unit_position;
2
 
3
typedef enum { STATUS_UNKNOWN, STATUS_UNSPECIFIED } unit_status;
4
 
5
typedef struct
6
{
7
  unit_position position;
8
  unit_status status;
9
} unit_flags;
10
 
11
extern void abort (void);
12
 
13
void
14
new_unit (unit_flags * flags)
15
{
16
  if (flags->status == STATUS_UNSPECIFIED)
17
    flags->status = STATUS_UNKNOWN;
18
 
19
  if (flags->position == POSITION_UNSPECIFIED)
20
    flags->position = POSITION_ASIS;
21
 
22
  switch (flags->status)
23
    {
24
    case STATUS_UNKNOWN:
25
      break;
26
 
27
    default:
28
      abort ();
29
    }
30
}
31
 
32
int main()
33
{
34
  unit_flags f;
35
  f.status = STATUS_UNSPECIFIED;
36
  new_unit (&f);
37
  return 0;
38
}

powered by: WebSVN 2.1.0

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