1 // { dg-require-effective-target vect_simd_clones } 2 // { dg-additional-options "-fopenmp-simd -fno-inline -DONE_FILE" } 3 // { dg-additional-options "-mavx" { target avx_runtime } } 4 5 #include "../../gcc.dg/vect/tree-vect.h" 6 7 #ifdef ONE_FILE 8 #include "simd-clone-3.cc" 9 #else 10 #include "simd-clone-2.h" 11 #endif 12 13 T b __attribute__((aligned (32))); 14 15 void do_main()16do_main () 17 { 18 int i, r = 0; 19 S a[64]; 20 for (i = 0; i < 64; i++) 21 { 22 a[i].s = i; 23 b.t[i] = i; 24 } 25 #pragma omp simd reduction(+:r) 26 for (i = 0; i < 64; i++) 27 r += a[16].f0 (i); 28 if (r != 64 * 63 / 2 + 64 * 16) 29 __builtin_abort (); 30 r = 0; 31 #pragma omp simd reduction(+:r) 32 for (i = 0; i < 64; i++) 33 r += a[32].f1 (i); 34 if (r != 64 * 63 / 2 + 64 * 32) 35 __builtin_abort (); 36 r = 0; 37 #pragma omp simd reduction(+:r) 38 for (i = 0; i < 64; i++) 39 r += a[i].f2 (i); 40 if (r != 64 * 63) 41 __builtin_abort (); 42 r = 0; 43 #pragma omp simd reduction(+:r) 44 for (i = 0; i < 64; i++) 45 r += b.f3 (i); 46 if (r != 64 * 63 / 2) 47 __builtin_abort (); 48 } 49 50 int main()51main () 52 { 53 check_vect (); 54 do_main (); 55 } 56