]>
Commit | Line | Data |
---|---|---|
8702ab14 AP |
1 | /* PR tree-optimization/109702 */ |
2 | /* { dg-do compile } */ | |
3 | /* { dg-options "-O2 -fdump-tree-optimized" } */ | |
4 | ||
5 | /* Test to make sure unrelated arguments and comparisons | |
6 | don't get optimized incorrectly. */ | |
7 | ||
8 | unsigned short test_bswap16(unsigned short x, unsigned short y) | |
9 | { | |
10 | return x ? __builtin_bswap16(y) : 0; | |
11 | } | |
12 | ||
13 | unsigned int test_bswap32(unsigned int x, unsigned int y) | |
14 | { | |
15 | return x ? __builtin_bswap32(y) : 0; | |
16 | } | |
17 | ||
18 | unsigned long long test_bswap64(unsigned long long x, unsigned long long y) | |
19 | { | |
20 | return x ? __builtin_bswap64(y) : 0; | |
21 | } | |
22 | ||
23 | int test_clrsb(int x, int y) | |
24 | { | |
25 | return x ? __builtin_clrsb(y) : (__SIZEOF_INT__*8-1); | |
26 | } | |
27 | ||
28 | int test_clrsbl(long x, long y) | |
29 | { | |
30 | return x ? __builtin_clrsbl(y) : (__SIZEOF_LONG__*8-1); | |
31 | } | |
32 | ||
33 | int test_clrsbll(long long x, long long y) | |
34 | { | |
35 | return x ? __builtin_clrsbll(y) : (__SIZEOF_LONG_LONG__*8-1); | |
36 | } | |
37 | ||
38 | int test_parity(unsigned int x, unsigned int y) | |
39 | { | |
40 | return x ? __builtin_parity(y) : 0; | |
41 | } | |
42 | ||
43 | int test_parityl(unsigned long x, unsigned long y) | |
44 | { | |
45 | return x ? __builtin_parityl(y) : 0; | |
46 | } | |
47 | ||
48 | int test_parityll(unsigned long long x, unsigned long long y) | |
49 | { | |
50 | return x ? __builtin_parityll(y) : 0; | |
51 | } | |
52 | ||
53 | int test_popcount(unsigned int x, unsigned int y) | |
54 | { | |
55 | return x ? __builtin_popcount(y) : 0; | |
56 | } | |
57 | ||
58 | int test_popcountl(unsigned long x, unsigned long y) | |
59 | { | |
60 | return x ? __builtin_popcountl(y) : 0; | |
61 | } | |
62 | ||
63 | int test_popcountll(unsigned long long x, unsigned long long y) | |
64 | { | |
65 | return x ? __builtin_popcountll(y) : 0; | |
66 | } | |
67 | ||
8c79b49c AP |
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" } } */ | |
64d90d06 | 70 | /* { dg-final { scan-tree-dump-times "x_..D. != 0" 12 "optimized" } } */ |