(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
gomp/
target-simd-clone-8.c
       1  /* { dg-options "-fopenmp -O2" } */
       2  /* { dg-additional-options "-fopenmp-target-simd-clone=any -fdump-ipa-simdclone-details" } */
       3  
       4  /* Test that simd clones are not generated for functions with 
       5     "declare target" but that read volatile memory in the body.  */
       6  
       7  extern volatile int save;
       8  
       9  #pragma omp declare target
      10  __attribute__ ((__noinline__)) int addit(int a, int b)
      11  {
      12    return save + a + b;
      13  }
      14  #pragma omp end declare target
      15  
      16  void callit (int *a, int *b, int *c)
      17  {
      18    int i;
      19    #pragma omp for simd
      20    for (i = 0; i < 16; i++)
      21      c[i] = addit (a[i], b[i]);
      22  }
      23  
      24  /* { dg-final { scan-ipa-dump "body includes volatile op" "simdclone" { target x86_64-*-* } } } */
      25  /* { dg-final { scan-ipa-dump-not "Generated .* clone" "simdclone" { target x86_64-*-* } } } */