blob: fc6fa8da0378f7db5036efd8186cb8d54f60ff1c [file] [log] [blame]
/* PR target/50749: Verify that post-increment addressing is generated
inside a loop. */
/* { dg-do compile } */
/* { dg-options "-O2" } */
/* { dg-final { scan-assembler-times "mov.b\t@r\[0-9]\+\\+,r\[0-9]\+" 3 { xfail *-*-*} } } */
/* { dg-final { scan-assembler-times "mov.w\t@r\[0-9]\+\\+,r\[0-9]\+" 3 { xfail *-*-*} } } */
/* { dg-final { scan-assembler-times "mov.l\t@r\[0-9]\+\\+,r\[0-9]\+" 3 { xfail *-*-*} } } */
int
test_func_00 (char* p, int c)
{
int r = 0;
do
{
r += *p++;
r += *p++;
r += *p++;
} while (--c);
return r;
}
int
test_func_01 (short* p, int c)
{
int r = 0;
do
{
r += *p++;
r += *p++;
r += *p++;
} while (--c);
return r;
}
int
test_func_02 (int* p, int c)
{
int r = 0;
do
{
r += *p++;
r += *p++;
r += *p++;
} while (--c);
return r;
}