1  /* { dg-do compile { target { ia32 } } } */
       2  /* { dg-options "-mprefetchi -O2" } */
       3  /* { dg-final { scan-assembler-not "\[ \\t\]+prefetchit0" } } */
       4  /* { dg-final { scan-assembler-not "\[ \\t\]+prefetchit1" } } */
       5  
       6  #include <x86intrin.h>
       7  
       8  int
       9  bar (int a)
      10  {
      11    return a + 1;
      12  }
      13  
      14  int
      15  foo1 (int b)
      16  {
      17    __builtin_ia32_prefetch (bar, 0, 3, 1); /* { dg-warning "instruction prefetch applies when in 64-bit mode with RIP-relative addressing and option '-mprefetchi'; they stay NOPs otherwise" } */
      18    return bar (b) + 1;
      19  }
      20  
      21  int
      22  foo2 (int b)
      23  {
      24    __builtin_ia32_prefetchi (bar, 2); /* { dg-warning "instruction prefetch applies when in 64-bit mode with RIP-relative addressing and option '-mprefetchi'; they stay NOPs otherwise" } */
      25    return bar (b) + 1;
      26  }