1 /* Make sure both loops are recognized as doloops.
2 If so, "bdnz" will be generated on ppc; if not,
3 you will get "ble" or "blt" or "bge". */
4
5 /* { dg-do compile { target powerpc*-*-* } } */
6 /* { dg-options "-O2" } */
foo(int count,char * pca,char * pcb)7 void foo (int count, char* pca, char* pcb) {
8 int i;
9 if (count > 10)
10 for (i = 0; i < count; ++i)
11 pcb += i;
12 else
13 for (i = 0; i < count; ++i)
14 pca += i;
15 *pca = *pcb;
16 }
17 /* { dg-final { scan-assembler "bdnz" } } */
18