2 /* { dg-require-effective-target stdint_types } */
3 /* { dg-options "-O2" } */
7 extern void abort (void);
9 uint64_t __attribute__((noinline
))
10 byteswap64(uint64_t x
)
13 uint32_t b
= (uint32_t) x
;
14 return ((uint64_t) ((((((b
)) >> (8)) | (((b
)) << (32 - (8)))) & 0xff00ff00L
)
15 | (((((b
)) << (8)) | (((b
)) >> (32 - (8)))) & 0x00ff00ffL
)) << 32)
16 | (uint64_t) ((((((a
)) >> (8)) | (((a
)) << (32 - (8)))) & 0xff00ff00L
)
17 | (((((a
)) << (8)) | (((a
)) >> (32 - (8)))) & 0x00ff00ffL
));
23 uint64_t in
= (uint64_t)0x01020304 << 32 | 0x05060708;
24 uint64_t cmp
= (uint64_t)0x08070605 << 32 | 0x04030201;
26 if (cmp
!= byteswap64 (in
))