summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/frv/fr550-builtins-1.c
blob: d728f12a4fc4672fc7fdadb26b6bcdc8b4c0fd7f (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
31
32
33
34
35
36
37
38
39
40
41
42
/* Test prefetch support.  */
/* { dg-do run } */
extern void abort (void);
extern void exit (int);

unsigned char global[64];

void
foo (unsigned int *x, int n)
{
  unsigned short local[16];

  __data_prefetch0 (x);
  __data_prefetch0 (&x[8]);
  __data_prefetch0 (&x[n]);
  __data_prefetch0 (local);
  __data_prefetch0 (&local[16]);
  __data_prefetch0 (&local[n]);
  __data_prefetch0 (global);
  __data_prefetch0 (&global[32]);
  __data_prefetch0 (&global[n]);

#if __FRV_VLIW__ > 1
  __data_prefetch (x);
  __data_prefetch (&x[8]);
  __data_prefetch (&x[n]);
  __data_prefetch (local);
  __data_prefetch (&local[16]);
  __data_prefetch (&local[n]);
  __data_prefetch (global);
  __data_prefetch (&global[32]);
  __data_prefetch (&global[n]);
#endif
}

int main ()
{
  unsigned int i[16];

  foo (i, 2);
  exit (0);
}