PR target/84226
[official-gcc.git] / gcc / testsuite / gcc.target / frv / fr550-builtins-1.c
blobd728f12a4fc4672fc7fdadb26b6bcdc8b4c0fd7f
1 /* Test prefetch support. */
2 /* { dg-do run } */
3 extern void abort (void);
4 extern void exit (int);
6 unsigned char global[64];
8 void
9 foo (unsigned int *x, int n)
11 unsigned short local[16];
13 __data_prefetch0 (x);
14 __data_prefetch0 (&x[8]);
15 __data_prefetch0 (&x[n]);
16 __data_prefetch0 (local);
17 __data_prefetch0 (&local[16]);
18 __data_prefetch0 (&local[n]);
19 __data_prefetch0 (global);
20 __data_prefetch0 (&global[32]);
21 __data_prefetch0 (&global[n]);
23 #if __FRV_VLIW__ > 1
24 __data_prefetch (x);
25 __data_prefetch (&x[8]);
26 __data_prefetch (&x[n]);
27 __data_prefetch (local);
28 __data_prefetch (&local[16]);
29 __data_prefetch (&local[n]);
30 __data_prefetch (global);
31 __data_prefetch (&global[32]);
32 __data_prefetch (&global[n]);
33 #endif
36 int main ()
38 unsigned int i[16];
40 foo (i, 2);
41 exit (0);