gcc/testsuite/gcc.target/pru/loop-si-2.c
raw| 1 | /* Test LOOP recognition */ |
| 2 | |
| 3 | /* { dg-options "-O1 -mloop" } */ |
| 4 | |
| 5 | /* -O1 in the options is significant. Without it do-loop will not be |
| 6 | run. */ |
| 7 | |
| 8 | unsigned int |
| 9 | test_loop (unsigned int n) |
| 10 | { |
| 11 | unsigned int i; |
| 12 | volatile unsigned int s = 0; |
| 13 | |
| 14 | if (n >= 0x10000) return 0; |
| 15 | |
| 16 | /* { dg-final { scan-assembler "loop\\t.L\[0-9\]*, r\[0-9\]*" } } */ |
| 17 | for (i = 0; i < n; i++) |
| 18 | s++; |
| 19 | return s; |
| 20 | } |