1 /* PR tree-optimization/109702 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -fdump-tree-optimized" } */
5 /* Test to make sure unrelated arguments and comparisons
6 don't get optimized incorrectly. */
8 __UINT16_TYPE__
test_bswap16(__UINT16_TYPE__ x
, __UINT16_TYPE__ y
)
10 return x
? __builtin_bswap16(y
) : 0;
13 __UINT32_TYPE__
test_bswap32(__UINT32_TYPE__ x
, __UINT32_TYPE__ y
)
15 return x
? __builtin_bswap32(y
) : 0;
18 __UINT64_TYPE__
test_bswap64(__UINT64_TYPE__ x
, __UINT64_TYPE__ y
)
20 return x
? __builtin_bswap64(y
) : 0;
23 int test_clrsb(int x
, int y
)
25 return x
? __builtin_clrsb(y
) : (__SIZEOF_INT__
*8-1);
28 int test_clrsbl(long x
, long y
)
30 return x
? __builtin_clrsbl(y
) : (__SIZEOF_LONG__
*8-1);
33 int test_clrsbll(long long x
, long long y
)
35 return x
? __builtin_clrsbll(y
) : (__SIZEOF_LONG_LONG__
*8-1);
38 int test_parity(unsigned int x
, unsigned int y
)
40 return x
? __builtin_parity(y
) : 0;
43 int test_parityl(unsigned long x
, unsigned long y
)
45 return x
? __builtin_parityl(y
) : 0;
48 int test_parityll(unsigned long long x
, unsigned long long y
)
50 return x
? __builtin_parityll(y
) : 0;
53 int test_popcount(unsigned int x
, unsigned int y
)
55 return x
? __builtin_popcount(y
) : 0;
58 int test_popcountl(unsigned long x
, unsigned long y
)
60 return x
? __builtin_popcountl(y
) : 0;
63 int test_popcountll(unsigned long long x
, unsigned long long y
)
65 return x
? __builtin_popcountll(y
) : 0;
68 /* 4 types of functions, each with 3 types and there are 2 goto each */
69 /* { dg-final { scan-tree-dump-times "goto " 24 "optimized" } } */
70 /* { dg-final { scan-tree-dump-times "x_..D. != 0" 12 "optimized" } } */