1 /* { dg-do compile { target { powerpc*-*-* } } } */
2 /* { dg-require-effective-target lp64 } */
3 /* { dg-require-effective-target powerpc_popcntb_ok } */
4 /* { dg-options "-mdejagnu-cpu=power5" } */
5
6 void abort ();
7
8 unsigned long long int
do_compare(unsigned long long int a,unsigned long long int b)9 do_compare (unsigned long long int a, unsigned long long int b)
10 {
11 return __builtin_cmpb (a, b); /* { dg-warning "implicit declaration of function '__builtin_cmpb'" } */
12 }
13
14 void
expect(unsigned long long int pattern,unsigned long long int value)15 expect (unsigned long long int pattern, unsigned long long int value)
16 {
17 if (pattern != value)
18 abort ();
19 }
20
21 int
main(int argc,char * argv[])22 main (int argc, char *argv[])
23 {
24 expect (0xff00000000000000LL,
25 do_compare (0x0123456789abcdefLL, 0x0100000000000000LL));
26 expect (0x00ffffffffffffff,
27 do_compare (0x0123456789abcdefLL, 0x0023456789abcdefLL));
28 expect (0x00000000000000ff,
29 do_compare (0x00000000000000efLL, 0x0123456789abcdefLL));
30 }
31