1 /* { dg-do compile { target { powerpc*-*-* } } } */
2 /* { dg-require-effective-target powerpc_p9vector_ok } */
3 /* { dg-skip-if "" { powerpc*-*-aix* } } */
4 /* { dg-options "-mdejagnu-cpu=power9" } */
5 
6 /* This test should succeed on both 32- and 64-bit configurations.  */
7 #include <altivec.h>
8 
9 int
test_byte_in_either_range(unsigned char b,unsigned char first_lo_bound,unsigned char first_hi_bound,unsigned char second_lo_bound,unsigned char second_hi_bound)10 test_byte_in_either_range (unsigned char b,
11 			   unsigned char first_lo_bound,
12 			   unsigned char first_hi_bound,
13 			   unsigned char second_lo_bound,
14 			   unsigned char second_hi_bound)
15 {
16   unsigned int range_encoding;
17   range_encoding = ((first_hi_bound << 24) | (first_lo_bound << 16)
18 		    | (second_hi_bound << 8) | second_lo_bound);
19 
20   return __builtin_byte_in_either_range (b, range_encoding);
21 }
22 
23 /* { dg-final { scan-assembler "cmprb" } } */
24 /* { dg-final { scan-assembler "setb" } } */
25