[RS6000] Link power10 testcases
[gcc.git] / gcc / testsuite / gcc.target / powerpc / cmpb32-1.c
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
8 do_compare (unsigned int a, unsigned int b)
9 {
10 return __builtin_cmpb (a, b);
11 }
12
13 void
14 expect (unsigned int pattern, unsigned int value)
15 {
16 if (pattern != value)
17 abort ();
18 }
19
20 int
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 }