builtin-has-attribute-4.c: Skip on 32-bit hppa*-*-hpux*.
[official-gcc.git] / gcc / testsuite / gcc.dg / optimize-bswapsi-5.c
blob5819fd7193c789f44a0996f914cddd2d98aa4682
1 /* { dg-do compile } */
2 /* { dg-require-effective-target bswap } */
3 /* { dg-options "-O2 -fdump-tree-bswap" } */
4 /* { dg-additional-options "-march=z900" { target s390-*-* } } */
6 struct L { unsigned int l[2]; };
7 union U { double a; struct L l; } u;
9 void
10 foo (double a, struct L *p)
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;
25 void
26 bar (double a, struct L *p)
28 foo (a, p);
31 /* { dg-final { scan-tree-dump-times "32 bit bswap implementation found at" 2 "bswap" } } */