(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
powerpc/
p10-identify.c
       1  /* { dg-do run { target { power10_hw } } } */
       2  /* { dg-do link { target { ! power10_hw } } } */
       3  /* { dg-require-effective-target power10_ok } */
       4  /* { dg-options "-mdejagnu-cpu=power10 -O2" } */
       5  
       6  /* This test will only run when the power10_hw_available test passes.
       7     If that test passes, then we expect to see that the cpu is Power10.
       8     If this is not the case, then the test environment has problems.
       9     If in the future there are cpus that pass the power10_hw test but
      10     are not power10, they will need to be added to this check. */
      11  
      12  #include <stdio.h>
      13  #include <stdlib.h>
      14  
      15  int
      16  main (int argc, char *argv[])
      17  {
      18    int ret = 0;
      19  #ifdef __BUILTIN_CPU_SUPPORTS__
      20    if ( !__builtin_cpu_is ("power10"))
      21      {
      22        printf ("Error: __builtin_cpu_is says this is not power10, but power10_hw test passed.\n");
      23        ret++;
      24      }
      25  #endif
      26    return ret;
      27  }