gcc/testsuite/gcc.target/i386/pr70359.c
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-options "-O2" } */ |
| 3 | |
| 4 | char* inttostr(int i, char* buf, int len) |
| 5 | { |
| 6 | unsigned int ui = (i > 0) ? i : -i; |
| 7 | char *p = buf + len - 1; |
| 8 | *p = '\0'; |
| 9 | do { |
| 10 | *--p = '0' + (ui % 10); |
| 11 | } while ((ui /= 10) != 0); |
| 12 | if (i < 0) { |
| 13 | *--p = '-'; |
| 14 | } |
| 15 | return p; |
| 16 | } |
| 17 | |
| 18 | /* In out-of-SSA we should have avoided splitting the latch edge of the |
| 19 | loop by inserting copies. */ |
| 20 | /* { dg-final { scan-assembler-times "L\[0-9\]+:" 2 } } */ |