| 1 |
/* { dg-do run } */ |
| 2 |
/* { dg-options "-O2" } */ |
| 3 |
|
| 4 |
extern void abort (void); |
| 5 |
|
| 6 |
int __attribute__ ((noinline)) |
| 7 |
test (unsigned int *a, int b) |
| 8 |
{ |
| 9 |
return b ? 1 : __builtin_parity (*a); |
| 10 |
} |
| 11 |
|
| 12 |
int __attribute__ ((noinline)) |
| 13 |
testl (unsigned long *a, int b) |
| 14 |
{ |
| 15 |
return b ? 1 : __builtin_parityl (*a); |
| 16 |
} |
| 17 |
|
| 18 |
int __attribute__ ((noinline)) |
| 19 |
testll (unsigned long long *a, int b) |
| 20 |
{ |
| 21 |
return b ? 1 : __builtin_parityll (*a); |
| 22 |
} |
| 23 |
|
| 24 |
int |
| 25 |
main () |
| 26 |
{ |
| 27 |
unsigned int a = 0; |
| 28 |
unsigned long al; |
| 29 |
unsigned long long all; |
| 30 |
|
| 31 |
a = 0x12345670; |
| 32 |
if (test (&a, 0)) |
| 33 |
abort (); |
| 34 |
|
| 35 |
al = 0x12345670ul; |
| 36 |
if (testl (&al, 0)) |
| 37 |
abort(); |
| 38 |
|
| 39 |
#if 1 |
| 40 |
all = 0x12345678abcdef0ull; |
| 41 |
if (testll (&all, 0)) |
| 42 |
abort (); |
| 43 |
#endif |
| 44 |
return 0; |
| 45 |
} |