2 /* { dg-require-effective-target int128 } */
3 /* { dg-require-effective-target stdint_types } */
4 /* { dg-options "-Wall" } */
8 #define MAKE_FUN(suffix, type) \
9 type my_bswap##suffix(type x) { \
12 for (shift = 0; shift < 8 * sizeof (type); shift += 8) \
15 result |= (x >> shift) & 0xff; \
20 MAKE_FUN(128, __uint128_t);
22 extern void abort (void);
26 struct { uint64_t lo
; uint64_t hi
; } s
;
32 { .s = { 0x0000000000000000ULL, 0x1122334455667788ULL } }, \
33 { .s = { 0x1122334455667788ULL, 0xffffffffffffffffULL } }, \
34 { .s = { 0xffffffffffffffffULL, 0x0000000000000000ULL } } \
37 u uint128_ts
[] = NUMS128
;
39 #define N(table) (sizeof (table) / sizeof (table[0]))
46 for (i
= 0; i
< N(uint128_ts
); i
++)
47 if (__builtin_bswap128 (uint128_ts
[i
].n
) != my_bswap128 (uint128_ts
[i
].n
))