Fix warning with -Wsign-compare -Wsystem-headers
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / byte-in-either-range-0.c
blobc98c0a868130e291bcf41eff01ffdcf04cc9f861
1 /* { dg-do compile { target { powerpc*-*-* } } } */
2 /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */
3 /* { dg-require-effective-target powerpc_p9vector_ok } */
4 /* { dg-skip-if "" { powerpc*-*-aix* } } */
5 /* { dg-options "-mcpu=power9" } */
7 /* This test should succeed on both 32- and 64-bit configurations. */
8 #include <altivec.h>
10 int
11 test_byte_in_either_range (unsigned char b,
12 unsigned char first_lo_bound,
13 unsigned char first_hi_bound,
14 unsigned char second_lo_bound,
15 unsigned char second_hi_bound)
17 unsigned int range_encoding;
18 range_encoding = ((first_hi_bound << 24) | (first_lo_bound << 16)
19 | (second_hi_bound << 8) | second_lo_bound);
21 return __builtin_byte_in_either_range (b, range_encoding);
24 /* { dg-final { scan-assembler "cmprb" } } */
25 /* { dg-final { scan-assembler "setb" } } */