1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-optimized" } */
4 int test1(int x
, int y
)
6 #if __SIZEOF_INT__ == 4
7 return __builtin_bswap32(x
) == __builtin_bswap32(y
);
13 int test2(int x
, int y
)
15 #if __SIZEOF_INT__ == 4
16 return __builtin_bswap32(x
) != __builtin_bswap32(y
);
24 #if __SIZEOF_INT__ == 4
25 return __builtin_bswap32(x
) == 12345;
33 #if __SIZEOF_INT__ == 4
34 return __builtin_bswap32(x
) != 12345;
40 int test1ll(long long x
, long long y
)
42 #if __SIZEOF_LONG_LONG__ == 8
43 return __builtin_bswap64(x
) == __builtin_bswap64(y
);
49 int test2ll(long long x
, long long y
)
51 #if __SIZEOF_LONG_LONG__ == 8
52 return __builtin_bswap64(x
) != __builtin_bswap64(y
);
58 int test3ll(long long x
)
60 #if __SIZEOF_LONG_LONG__ == 8
61 return __builtin_bswap64(x
) == 12345;
67 int test4ll(long long x
)
69 #if __SIZEOF_LONG_LONG__ == 8
70 return __builtin_bswap64(x
) != 12345;
76 int test1s(short x
, short y
)
78 #if __SIZEOF_SHORT__ == 2
79 return __builtin_bswap16(x
) == __builtin_bswap16(y
);
85 int test2s(short x
, short y
)
87 #if __SIZEOF_SHORT__ == 2
88 return __builtin_bswap16(x
) != __builtin_bswap16(y
);
96 #if __SIZEOF_SHORT__ == 2
97 return __builtin_bswap16(x
) == 12345;
105 #if __SIZEOF_SHORT__ == 2
106 return __builtin_bswap16(x
) != 12345;
112 /* { dg-final { scan-tree-dump-times "__builtin_bswap" 0 "optimized" } } */