1  /* { dg-do compile } */
       2  /* { dg-additional-options "-msse2" { target sse2 } } */
       3  
       4  void swap(short *p, int cnt)
       5  {
       6    while (cnt-- > 0)
       7      {
       8        *p = ((*p << 8) & 0xFF00) | ((*p >> 8) & 0x00FF);
       9        ++p;
      10      }
      11  }
      12  
      13  /* Dependence analysis should not fail.  */
      14  /* { dg-final { scan-tree-dump "dependence distance == 0" "vect" } } */
      15  /* On x86 with SSE2 we can vectorize this with psllw/psrlw.  */
      16  /* { dg-final { scan-tree-dump "loop vectorized" "vect" { target sse2 } } } */