aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/powerpc/byte-in-either-range-1.c
blob: 8e84c77e68253a119f820d62bc2ead599999ac15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* { dg-do compile { target { powerpc*-*-* } } } */
/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */
/* { dg-require-effective-target powerpc_p9vector_ok } */
/* { dg-skip-if "" { powerpc*-*-aix* } } */
/* { dg-options "-mcpu=power8" } */

/* This test should succeed on both 32- and 64-bit configurations.  */
#include <altivec.h>

bool int
test_byte_in_range (unsigned char b,
		    unsigned char first_lo_bound,
		    unsigned char first_hi_bound,
		    unsigned char second_lo_bound,
		    unsigned char second_hi_bound)
{
  unsigned int range_encoding;
  range_encoding = ((first_hi_bound << 24) | (lo_hi_bound << 16)
		    (second_hi_bound << 8) | second_lo_bound);

  return __builtin_scalar_byte_in_either_range (b, range_encoding); /* { dg-error "Builtin function __builtin_scalar_byte_in_either_range requires" } */
}