(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
powerpc/
cmpb32-2.c
       1  /* { dg-do compile { target { powerpc*-*-* } } } */
       2  /* { dg-require-effective-target powerpc_popcntb_ok } */
       3  /* { dg-options "-mdejagnu-cpu=power5" } */
       4  
       5  void abort ();
       6  
       7  unsigned int
       8  do_compare (unsigned int a, unsigned int b)
       9  {
      10    return __builtin_cmpb (a, b);  /* { dg-error "'__builtin_p6_cmpb_32' requires the '-mcpu=power6' option" } */
      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  }