Merge reload-branch up to revision 101000
[official-gcc.git] / gcc / testsuite / g++.dg / opt / longbranch2.C
blobdbc8a1d94d2360442b2c3168bcd62dbd83d2d2bb
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-*-* && ilp32 } } }
6 // { dg-options "-O3 -funroll-loops -mtune=k6 -fomit-frame-pointer" { target { x86_64-*-* && ilp32 } } }
9 // This used to fail to assemble because of an out-of-range 'loop' instructions.
12 class JKeeper {
13 public:
14   unsigned long a0;
17 class EBCOTLut : public JKeeper {
18   unsigned char a1[1<<8];   
19   unsigned char a2[1<<8];
20   unsigned char a3[1<<8];
21   long          a4[1<<9];
22 public:
23   EBCOTLut(void);
26 EBCOTLut::EBCOTLut(void)
28   unsigned char inter[36];   // intermediate lookup table;
29   unsigned long i;
30   for(i=0;i<36;i++) {
31     inter[i] = 0;
32   }
33   for(i=1;i<16;i++) {
34     a1[i | (1<<7)] = 8<<1;
35     a1[i | (1<<6)] = 8<<1;
36   }
37   for(i=0;i < ((1<<9)-1);i++) {
38     int ds = (i>>0) & 0x01;    // significance of DOWN
39     int us = (i>>1) & 0x01;    // significance of UP
40     int rs = (i>>2) & 0x01;    // significance of RIGHT
41     int ls = (i>>3) & 0x01;    // significance of LEFT
42     int dn = (i>>5) & 0x01;    // sign of DOWN
43     int un = (i>>6) & 0x01;    // sign of UP
44     int rn = (i>>7) & 0x01;    // sign of RIGHT
45     int ln = (i>>8) & 0x01;    // sign of LEFT
46     int h,v;                   // h and v as in the VM description
48     h = ls*(1-ln*2) + rs*(1-2*rn);
49     v = us*(1-un*2) + ds*(1-2*dn);
50     h = (h >= -1)?(h):(-1);
51     v = (v >= -1)?(v):(-1);
52     h = (h <=  1)?(h):(1);
53     v = (v <=  1)?(v):(1);
54     a2[i] = inter[((h+1)<<3) | (v+1)];
55     a3[i] = inter[((h+1)<<3) | (v+1)] & (unsigned char)(~1);
56   }
57   for(i=0;i< 1<<9; i++) {
58     a4[i]    = 2*(i-(1<<(9-1)))*(i-(1<<(9-1))) - 
59       ((i< (1<<(9-1)))?
60        (2*(i-(1<<(9-2)))*(i-(1<<(9-2)))):
61        (2*(i-(3<<(9-2)))*(i-(3<<(9-2)))));
63   }
64