(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
optimize-bswapsi-5.c
       1  /* { dg-do compile } */
       2  /* { dg-require-effective-target bswap } */
       3  /* { dg-options "-O2 -fno-tree-vectorize -fdump-tree-optimized -fno-inline-functions" } */
       4  /* { dg-additional-options "-march=z900" { target s390-*-* } } */
       5  
       6  struct L { unsigned int l[2]; };
       7  union U { double a; struct L l; } u;
       8  
       9  void
      10  foo (double a, struct L *p)
      11  {
      12    u.a = a;
      13    struct L l = u.l, m;
      14    m.l[0] = (((l.l[1] & 0xff000000) >> 24)
      15  	    | ((l.l[1] & 0x00ff0000) >> 8)
      16  	    | ((l.l[1] & 0x0000ff00) << 8)
      17  	    | ((l.l[1] & 0x000000ff) << 24));
      18    m.l[1] = (((l.l[0] & 0xff000000) >> 24)
      19  	    | ((l.l[0] & 0x00ff0000) >> 8)
      20  	    | ((l.l[0] & 0x0000ff00) << 8)
      21  	    | ((l.l[0] & 0x000000ff) << 24));
      22    *p = m;
      23  }
      24  
      25  void
      26  bar (double a, struct L *p)
      27  {
      28    foo (a, p);
      29  }
      30  
      31  /* { dg-final { scan-tree-dump-times "= __builtin_bswap32 \\\(" 2 "optimized" } } */