1  /* Testcase to check generation of the operand cache prefetch instruction
       2     PREF @Rm.  */
       3  /* { dg-do compile { target { has_pref } } }  */
       4  /* { dg-options "-O0" }  */
       5  /* { dg-final { scan-assembler "pref" } }  */
       6  
       7  void
       8  opt (void)
       9  {
      10    int *p, wk;
      11    int data[100];
      12  
      13    /* data prefetch , instructions hit the cache. */
      14  
      15    __builtin_prefetch (&data[0], 0, 0);
      16    __builtin_prefetch (&data[0], 0, 1);
      17    __builtin_prefetch (&data[0], 0, 2);
      18    __builtin_prefetch (&data[0], 0, 3);
      19    __builtin_prefetch (&data[0], 1, 0);
      20    __builtin_prefetch (&data[0], 1, 1);
      21    __builtin_prefetch (&data[0], 1, 2);
      22    __builtin_prefetch (&data[0], 1, 3);
      23  
      24  
      25    for (p = &data[0]; p < &data[9]; p++)
      26      {
      27        if (*p > *(p + 1))
      28          {
      29            wk = *p;
      30            *p = *(p + 1);
      31            *(p + 1) = wk;
      32          }
      33      }
      34  }