gcc.c-torture/execute/builtins/fputs.c: fputs_unlocked prototype
[official-gcc.git] / libgomp / testsuite / libgomp.c / target-simd-clone-1.c
bloba9defc4cdd6fdee61f5808ee64c3faf601f55a26
1 /* { dg-do link { target { offload_target_amdgcn } } } */
2 /* { dg-additional-options "-O2 -foffload-options=-fdump-ipa-simdclone-details" } */
4 /* Test that simd clones for the offload processor are generated for
5 functions with "declare target" when enabled by default at -O2. */
7 #pragma omp declare target
8 __attribute__ ((__noinline__)) int addit (int a, int b)
10 return a + b;
13 __attribute__ ((__noinline__))
14 void callit (int *a, int *b, int *c)
16 int i;
17 #pragma omp for simd
18 for (i = 0; i < 16; i++)
19 c[i] = addit (a[i], b[i]);
21 #pragma omp end declare target
23 int main (void)
25 int aa[16], bb[16], cc[16];
26 int i;
27 for (i = 0; i < 16; i++)
29 aa[i] = i;
30 bb[i] = -i;
32 callit (aa, bb, cc);
33 for (i = 0; i < 16; i++)
34 if (cc[i] != 0)
35 return 1;
36 return 0;
39 /* Although addit has external linkage, we expect clones to be generated as
40 for a function with internal linkage. */
42 /* { dg-final { scan-offload-ipa-dump "Generated local clone _ZGV.*N.*_addit" "simdclone" } } */
43 /* { dg-final { scan-offload-ipa-dump "Generated local clone _ZGV.*M.*_addit" "simdclone" } } */