2018-02-09 Sebastian Perta <sebastian.perta@renesas.com>
[official-gcc.git] / gcc / testsuite / gcc.target / sh / pr50749-qihisi-postinc-3.c
blob6e54d4dd721360d27b83e6fd3d1c60ee1250da0e
1 /* PR target/50749: Verify that post-increment addressing is generated
2 inside a loop. */
3 /* { dg-do compile } */
4 /* { dg-options "-O2" } */
5 /* { dg-final { scan-assembler-times "mov.b\t@r\[0-9]\+\\+,r\[0-9]\+" 1 } } */
6 /* { dg-final { scan-assembler-times "mov.w\t@r\[0-9]\+\\+,r\[0-9]\+" 1 } } */
7 /* { dg-final { scan-assembler-times "mov.l\t@r\[0-9]\+\\+,r\[0-9]\+" 1 } } */
9 int
10 test_func_00 (char* p, int c)
12 int r = 0;
15 r += *p++;
16 } while (--c);
17 return r;
20 int
21 test_func_01 (short* p, int c)
23 int r = 0;
26 r += *p++;
27 } while (--c);
28 return r;
31 int
32 test_func_02 (int* p, int c)
34 int r = 0;
37 r += *p++;
38 } while (--c);
39 return r;