2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.dg / opt / longbranch2.C
blobb74ceddf085c02d73c902fc89b5236f2ef39fd22
1 // PR target/11689
2 // Originator: thor@math.tu-berlin.de
4 // { dg-do compile }
5 // { dg-options "-O3 -funroll-loops -mtune=k6 -fomit-frame-pointer" { target i?86-*-*  } }
7 // This used to fail to assemble because of an out-of-range 'loop' instructions.
10 class JKeeper {
11 public:
12   unsigned long a0;
15 class EBCOTLut : public JKeeper {
16   unsigned char a1[1<<8];   
17   unsigned char a2[1<<8];
18   unsigned char a3[1<<8];
19   long          a4[1<<9];
20 public:
21   EBCOTLut(void);
24 EBCOTLut::EBCOTLut(void)
26   unsigned char inter[36];   // intermediate lookup table;
27   unsigned long i;
28   for(i=0;i<36;i++) {
29     inter[i] = 0;
30   }
31   for(i=1;i<16;i++) {
32     a1[i | (1<<7)] = 8<<1;
33     a1[i | (1<<6)] = 8<<1;
34   }
35   for(i=0;i < ((1<<9)-1);i++) {
36     int ds = (i>>0) & 0x01;    // significance of DOWN
37     int us = (i>>1) & 0x01;    // significance of UP
38     int rs = (i>>2) & 0x01;    // significance of RIGHT
39     int ls = (i>>3) & 0x01;    // significance of LEFT
40     int dn = (i>>5) & 0x01;    // sign of DOWN
41     int un = (i>>6) & 0x01;    // sign of UP
42     int rn = (i>>7) & 0x01;    // sign of RIGHT
43     int ln = (i>>8) & 0x01;    // sign of LEFT
44     int h,v;                   // h and v as in the VM description
46     h = ls*(1-ln*2) + rs*(1-2*rn);
47     v = us*(1-un*2) + ds*(1-2*dn);
48     h = (h >= -1)?(h):(-1);
49     v = (v >= -1)?(v):(-1);
50     h = (h <=  1)?(h):(1);
51     v = (v <=  1)?(v):(1);
52     a2[i] = inter[((h+1)<<3) | (v+1)];
53     a3[i] = inter[((h+1)<<3) | (v+1)] & (unsigned char)(~1);
54   }
55   for(i=0;i< 1<<9; i++) {
56     a4[i]    = 2*(i-(1<<(9-1)))*(i-(1<<(9-1))) - 
57       ((i< (1<<(9-1)))?
58        (2*(i-(1<<(9-2)))*(i-(1<<(9-2)))):
59        (2*(i-(3<<(9-2)))*(i-(3<<(9-2)))));
61   }
62