aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/gomp/target-simd-clone-5.c
blob: 93f9774f83190f7a1f234cc38d2f5aa487195be6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* { dg-options "-fopenmp -O2" } */
/* { dg-additional-options "-fopenmp-target-simd-clone=any -fdump-ipa-simdclone-details" } */

/* Test that simd clones are not generated for functions with 
   "declare target" but unsuitable arguments.  */

struct s {
  int a;
  int b;
};
  
#pragma omp declare target
__attribute__ ((__noinline__)) int addit (struct s x)
{
  return x.a + x.b;
}
#pragma omp end declare target

void callit (struct s *ss, int *c)
{
  int i;
  #pragma omp for simd
  for (i = 0; i < 16; i++)
    c[i] = addit (ss[i]);
}

/* { dg-final { scan-ipa-dump "argument type fails sniff test" "simdclone" { target x86_64-*-* } } } */
/* { dg-final { scan-ipa-dump-not "Generated .* clone" "simdclone" { target x86_64-*-* } } } */