summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/sh/pr61142.c
blob: 4f48b0500d4536a1c1fc85aecf7d64e8664c5286 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* Check that @(r0,rm),rn insns load into r0.  */
/* { dg-do compile }  */
/* { dg-options "-O2" }  */
/* { dg-final { scan-assembler-times "mov.b\t@\\(r0,r\[0123456789\]\\),r0" 1 } }  */
/* { dg-final { scan-assembler-times "mov.w\t@\\(r0,r\[0123456789\]\\),r0" 1 } }  */
/* { dg-final { scan-assembler-times "mov.l\t@\\(r0,r\[0123456789\]\\),r0" 1 } }  */

int
test_00 (const char* x, int a, int b, int c)
{
  if (x[a] == 92)
    return b;
  return c;
}

int
test_01 (const short* x, int a, int b, int c)
{
  if (x[a] == 92)
    return b;
  return c;
}

int
test_02 (const int* x, int a, int b, int c)
{
  if (x[a] == 92)
    return b;
  return c;
}