OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [noncompile/] [971104-1.c] - Blame information for rev 154

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
extern int printf(const char *, ...);
2
typedef unsigned short          ushort;
3
struct sembuf {
4
  ushort  sem_num;
5
  short   sem_op;
6
  short   sem_flg;
7
};
8
union semun {
9
  int val;
10
  struct semid_ds *buf;
11
  ushort *array;
12
  struct seminfo *__buf;
13
  void *__pad;
14
};
15
static union semun semctl_arg;
16
static int semid;
17
static void up(int sem){
18
  struct sembuf sb;
19
  sb.sem_num = (unsigned short) sem;
20
  sb.sem_op  = 1;
21
  sb.sem_flg = 0x1000 ;
22
  if(semop(semid, &sb, 1) == -1) error("up failure");
23
  if(semctl(semid, sb.sem_num, 12 , semctl_arg) == 0)
24
    printf("%s had processes sleeping on it!\n",
25
    ({ "MUTEX     ", "BARB_SEM 1", "BARB_SEM 2", "CUST_SEM 1",
26
       "CUST_SEM 2", "WAIT_SEM 1", "WAIT_SEM 2", "WAIT_SEM 3",
27
       "WAIT_SEM 4"}     /* { dg-error "parse error|syntax error|expected" } */
28
        [( sb.sem_num )]) ); /* { dg-error "expected" } */
29
}

powered by: WebSVN 2.1.0

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