PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / 920302-1.c
blob62e4fc205a94653629095230d27efc64c2cdd116
1 /* { dg-require-effective-target label_values } */
3 short optab[5];
4 char buf[10];
5 execute (ip)
6 register short *ip;
8 register void *base = &&x;
9 char *bp = buf;
10 static void *tab[] = {&&x, &&y, &&z};
11 if (ip == 0)
13 int i;
14 for (i = 0; i < 3; ++i)
15 optab[i] = (short)(tab[i] - base);
16 return;
18 x: *bp++='x';
19 goto *(base + *ip++);
20 y: *bp++='y';
21 goto *(base + *ip++);
22 z: *bp++='z';
23 *bp=0;
24 return;
27 short p[5];
29 main ()
31 execute ((short *) 0);
32 p[0] = optab[1];
33 p[1] = optab[0];
34 p[2] = optab[1];
35 p[3] = optab[2];
36 execute (&p);
37 if (strcmp (buf, "xyxyz"))
38 abort ();
39 exit (0);