aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/powerpc/cmpb-3.c
blob: 43de37a571d5412db370964e0739441525243103 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* { dg-do compile { target { powerpc*-*-* } } } */
/* Skip powerpc*-*-darwin* powerpc-*-eabi as dropped popcntb_ok.  */
/* { dg-skip-if "" { powerpc*-*-darwin* powerpc-*-eabi } } */
/* { dg-require-effective-target ilp32 } */
/* { dg-options "-mdejagnu-cpu=power6" } */

void abort ();

long long int
do_compare (long long int a, long long int b)
{
  return __builtin_cmpb (a, b);	/* { dg-error "'__builtin_p6_cmpb' requires the '-mcpu=power6' option and either the '-m64' or '-mpowerpc64' option" } */
}

void expect (long long int pattern, long long int value)
{
  if (pattern != value)
    abort ();
}

int
main (int argc, char *argv[])
{
  expect (0xff00000000000000LL,
	  do_compare (0x0123456789abcdefLL, 0x0100000000000000LL));
  expect (0x00ffffffffffffff,
	  do_compare (0x0123456789abcdefLL, 0x0023456789abcdefLL));
  expect (0x00000000000000ff,
	  do_compare (0x00000000000000efLL, 0x0123456789abcdefLL));
}