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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [980526-1.c] - Blame information for rev 297

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 297 jeremybenn
int expect_do1 = 1, expect_do2 = 2;
2
 
3
static int doit(int x){
4
  __label__ lbl1;
5
  __label__ lbl2;
6
  static int jtab_init = 0;
7
  static void *jtab[2];
8
 
9
  if(!jtab_init) {
10
    jtab[0] = &&lbl1;
11
    jtab[1] = &&lbl2;
12
    jtab_init = 1;
13
  }
14
  goto *jtab[x];
15
lbl1:
16
  return 1;
17
lbl2:
18
  return 2;
19
}
20
 
21
static void do1(void) {
22
  if (doit(0) != expect_do1)
23
    abort ();
24
}
25
 
26
static void do2(void){
27
  if (doit(1) != expect_do2)
28
    abort ();
29
}
30
 
31
int main(void){
32
#ifndef NO_LABEL_VALUES
33
  do1();
34
  do2();
35
#endif
36
  exit(0);
37
}

powered by: WebSVN 2.1.0

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