1 /* { dg-do run { target { powerpc*-*-* } } } */
2 /* { dg-require-effective-target dfp_hw } */
3 /* { dg-options "-mdejagnu-cpu=power6" } */
4
5 void abort ();
6
7 unsigned int
do_compare(unsigned int a,unsigned int b)8 do_compare (unsigned int a, unsigned int b)
9 {
10 return __builtin_cmpb (a, b);
11 }
12
13 void
expect(unsigned int pattern,unsigned int value)14 expect (unsigned int pattern, unsigned int value)
15 {
16 if (pattern != value)
17 abort ();
18 }
19
20 int
main(int argc,char * argv[])21 main (int argc, char *argv[])
22 {
23 expect (0xff000000, do_compare (0x12345678, 0x12000000));
24 expect (0x00ffffff, do_compare (0x12345678, 0x00345678));
25 expect (0x000000ff, do_compare (0x00000078, 0x12345678));
26 }
27