| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -fdump-tree-optimized" } */ |
| 3 |
|
| 4 |
unsigned short test_bswap16(unsigned short x) |
| 5 |
{ |
| 6 |
if (x) |
| 7 |
return __builtin_bswap16(x); |
| 8 |
return 0; |
| 9 |
} |
| 10 |
|
| 11 |
unsigned int test_bswap32(unsigned int x) |
| 12 |
{ |
| 13 |
if (x) |
| 14 |
return __builtin_bswap32(x); |
| 15 |
return 0; |
| 16 |
} |
| 17 |
|
| 18 |
unsigned long long test_bswap64(unsigned long long x) |
| 19 |
{ |
| 20 |
if (x) |
| 21 |
return __builtin_bswap64(x); |
| 22 |
return 0; |
| 23 |
} |
| 24 |
|
| 25 |
int test_clrsb(int x) |
| 26 |
{ |
| 27 |
if (x) |
| 28 |
return __builtin_clrsb(x); |
| 29 |
return (__SIZEOF_INT__*8-1); |
| 30 |
} |
| 31 |
|
| 32 |
int test_clrsbl(long x) |
| 33 |
{ |
| 34 |
if (x) |
| 35 |
return __builtin_clrsbl(x); |
| 36 |
return (__SIZEOF_LONG__*8-1); |
| 37 |
} |
| 38 |
|
| 39 |
int test_clrsbll(long long x) |
| 40 |
{ |
| 41 |
if (x) |
| 42 |
return __builtin_clrsbll(x); |
| 43 |
return (__SIZEOF_LONG_LONG__*8-1); |
| 44 |
} |
| 45 |
|
| 46 |
int test_parity(int x) |
| 47 |
{ |
| 48 |
if (x) |
| 49 |
return __builtin_parity(x); |
| 50 |
return 0; |
| 51 |
} |
| 52 |
|
| 53 |
int test_parityl(long x) |
| 54 |
{ |
| 55 |
if (x) |
| 56 |
return __builtin_parityl(x); |
| 57 |
return 0; |
| 58 |
} |
| 59 |
|
| 60 |
int test_parityll(long long x) |
| 61 |
{ |
| 62 |
if (x) |
| 63 |
return __builtin_parityll(x); |
| 64 |
return 0; |
| 65 |
} |
| 66 |
|
| 67 |
int test_popcount(int x) |
| 68 |
{ |
| 69 |
if (x) |
| 70 |
return __builtin_popcount(x); |
| 71 |
return 0; |
| 72 |
} |
| 73 |
|
| 74 |
int test_popcountl(long x) |
| 75 |
{ |
| 76 |
if (x) |
| 77 |
return __builtin_popcountl(x); |
| 78 |
return 0; |
| 79 |
} |
| 80 |
|
| 81 |
int test_popcountll(long long x) |
| 82 |
{ |
| 83 |
if (x) |
| 84 |
return __builtin_popcountll(x); |
| 85 |
return 0; |
| 86 |
} |
| 87 |
|
| 88 |
/* { dg-final { scan-tree-dump-not "goto" "optimized" } } */ |
| 89 |
|