| 1 |
/* { dg-do compile { target { powerpc*-*-* } } } */ |
| 2 |
/* Skip powerpc*-*-darwin* powerpc-*-eabi as dropped popcntb_ok. */ |
| 3 |
/* { dg-skip-if "" { powerpc*-*-darwin* powerpc-*-eabi } } */ |
| 4 |
/* { dg-options "-mdejagnu-cpu=power5" } */ |
| 5 |
|
| 6 |
void abort (); |
| 7 |
|
| 8 |
unsigned int |
| 9 |
do_compare (unsigned int a, unsigned int b) |
| 10 |
{ |
| 11 |
return __builtin_cmpb (a, b); /* { dg-error "'__builtin_p6_cmpb_32' requires the '-mcpu=power6' option" } */ |
| 12 |
} |
| 13 |
|
| 14 |
void |
| 15 |
expect (unsigned int pattern, unsigned int value) |
| 16 |
{ |
| 17 |
if (pattern != value) |
| 18 |
abort (); |
| 19 |
} |
| 20 |
|
| 21 |
int |
| 22 |
main (int argc, char *argv[]) |
| 23 |
{ |
| 24 |
expect (0xff000000, do_compare (0x12345678, 0x12000000)); |
| 25 |
expect (0x00ffffff, do_compare (0x12345678, 0x00345678)); |
| 26 |
expect (0x000000ff, do_compare (0x00000078, 0x12345678)); |
| 27 |
} |