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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [enum-incomplete-1.c] - Rev 801

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

/* Test for uses of incomplete enum variables: should be allowed just
   when incomplete structs are allowed.  PR 32295.  */
/* Origin: Joseph Myers <joseph@codesourcery.com> */
/* { dg-do compile } */
/* { dg-options "" } */
 
extern enum e ve;
extern struct s vs;
void *p;
 
int
f0 (int i)
{
  ve; /* { dg-error "incomplete" } */
  vs; /* { dg-error "incomplete" } */
  (void) ve;
  (void) vs;
  (void) (i ? ve : ve); /* { dg-error "incomplete" } */
  (void) (i ? vs : vs); /* { dg-error "incomplete" } */
  (void) (ve = ve); /* { dg-error "incomplete" } */
  (void) (vs = vs); /* { dg-error "incomplete" } */
  (void) ve, (void) ve;
  (void) vs, (void) vs;
  p = &ve;
  p = &vs;
  (void) sizeof (ve); /* { dg-error "incomplete" } */
  (void) sizeof (vs); /* { dg-error "incomplete" } */
  typeof (ve) *pe;
  typeof (vs) *ps;
  /* ??? alignof should probably not be accepted here.  */
  (void) __alignof (ve);
  (void) __alignof (vs);
  (void) (ve + i); /* { dg-error "incomplete" } */
  (void) (i * ve); /* { dg-error "incomplete" } */
  (void) (i / ve); /* { dg-error "incomplete" } */
  (void) (ve - i); /* { dg-error "incomplete" } */
  (void) (ve << i); /* { dg-error "incomplete" } */
  (void) (i >> ve); /* { dg-error "incomplete" } */
  (void) (ve < i); /* { dg-error "incomplete" } */
  (void) (ve <= i); /* { dg-error "incomplete" } */
  (void) (i > ve); /* { dg-error "incomplete" } */
  (void) (i >= ve); /* { dg-error "incomplete" } */
  (void) (ve == i); /* { dg-error "incomplete" } */
  (void) (i != ve); /* { dg-error "incomplete" } */
  (void) (ve & i); /* { dg-error "incomplete" } */
  (void) (ve ^ i); /* { dg-error "incomplete" } */
  (void) (i | ve); /* { dg-error "incomplete" } */
  (void) (i && ve); /* { dg-error "incomplete" } */
  (void) (ve || i); /* { dg-error "incomplete" } */
  (void) -ve; /* { dg-error "incomplete" } */
  (void) +ve; /* { dg-error "incomplete" } */
  (void) ~ve; /* { dg-error "incomplete" } */
  (void) !ve; /* { dg-error "incomplete" } */
  (void) --ve; /* { dg-error "incomplete" } */
  (void) ++ve; /* { dg-error "incomplete" } */
  (void) ve--; /* { dg-error "incomplete" } */
  (void) ve++; /* { dg-error "incomplete" } */
  i = ve; /* { dg-error "incomplete" } */
  i *= ve; /* { dg-error "incomplete" } */
  i /= ve; /* { dg-error "incomplete" } */
  i %= ve; /* { dg-error "incomplete" } */
  i += ve; /* { dg-error "incomplete" } */
  i -= ve; /* { dg-error "incomplete" } */
  i <<= ve; /* { dg-error "incomplete" } */
  i >>= ve; /* { dg-error "incomplete" } */
  i &= ve; /* { dg-error "incomplete" } */
  i ^= ve; /* { dg-error "incomplete" } */
  i |= ve; /* { dg-error "incomplete" } */
  (void) (ve ? 1 : 1); /* { dg-error "incomplete" } */
  (void) (int) ve; /* { dg-error "incomplete" } */
  f0 (ve); /* { dg-error "incomplete" } */
  if (ve) /* { dg-error "incomplete" } */
    ;
  do
    ;
  while (ve); /* { dg-error "incomplete" } */
  while (ve) /* { dg-error "incomplete" } */
    ;
  _Bool b = ve; /* { dg-error "incomplete" } */
  float f = ve; /* { dg-error "incomplete" } */
  switch (ve) /* { dg-error "incomplete" } */
    ;
  for (; ve;) /* { dg-error "incomplete" } */
    ;
  return ve; /* { dg-error "incomplete" } */
}
 

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

powered by: WebSVN 2.1.0

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