1 /* { dg-do assemble } */
2 /* { dg-skip-if "too much code for avr" { "avr-*-*" } } */
3 /* { dg-skip-if "too much code for pdp11" { "pdp11-*-*" } } */
4 /* { dg-skip-if "" { m32c-*-* } } */
5 /* { dg-skip-if "jumps too far for eBPF" { bpf-*-* } } */
6 /* { dg-timeout-factor 4.0 } */
7 
8 /* This testcase exposed two branch shortening bugs on powerpc.  */
9 
10 #define C(a,b) \
11   if (a > b)  goto gt; \
12   if (a < b)  goto lt;
13 
14 #define C4(x,b) C((x)[0], b) C((x)[1],b) C((x)[2],b) C((x)[3],b)
15 #define C16(x,y) C4(x, (y)[0]) C4(x, (y)[1]) C4(x, (y)[2]) C4(x, (y)[3])
16 
17 #define C64(x,y) C16(x,y) C16(x+4,y) C16(x+8,y) C16(x+12,y)
18 #define C256(x,y) C64(x,y) C64(x,y+4) C64(x,y+8) C64(x,y+12)
19 
20 #define C1024(x,y) C256(x,y) C256(x+16,y) C256(x+32,y) C256(x+48,y)
21 #define C4096(x,y) C1024(x,y) C1024(x,y+16) C1024(x,y+32) C1024(x,y+48)
22 
foo(int x[64],int y[64])23 unsigned foo(int x[64], int y[64])
24 {
25   C4096(x,y);
26 
27   return 0x01234567;
28  gt:
29   return 0x12345678;
30  lt:
31   return 0xF0123456;
32 }
33 
34