2018-10-31 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / pr70359.c
blob85b7017e386509d0b9d72851ddcb414512862cd2
1 /* { dg-do compile } */
2 /* { dg-options "-O2" } */
4 char* inttostr(int i, char* buf, int len)
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 = '-';
15 return p;
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 } } */