Set num_threads to 50 on 32-bit hppa in two libgomp loop tests
[official-gcc.git] / libgomp / testsuite / libgomp.c-c++-common / lastprivate-conditional-7.c
blob3b5875550a0295d93ac7e004191f1a5bb80ba272
1 /* { dg-do run } */
2 /* { dg-additional-options "-O2 -fvect-cost-model=cheap -fdump-tree-vect-details" } */
3 /* { dg-additional-options "-mavx" { target avx_runtime } } */
4 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 3 "vect" { target avx_runtime } } } */
6 int v, x;
8 __attribute__((noipa)) void
9 foo (int *a)
11 #pragma omp for simd lastprivate (conditional: x) schedule(simd: static)
12 for (int i = 0; i < 128; i++)
13 if (a[i])
14 x = a[i];
17 __attribute__((noipa)) void
18 bar (int *a, int *b)
20 #pragma omp for simd lastprivate (conditional: x, v) schedule(static, 16)
21 for (int i = 16; i < 128; ++i)
23 if (a[i])
24 x = a[i];
25 if (b[i])
26 v = b[i] + 10;
30 __attribute__((noipa)) void
31 baz (int *a)
33 #pragma omp for simd lastprivate (conditional: x) schedule(simd: dynamic, 16)
34 for (int i = 0; i < 128; i++)
35 if (a[i])
36 x = a[i] + 5;
39 int
40 main ()
42 int a[128], b[128], i;
43 for (i = 0; i < 128; i++)
45 a[i] = ((i % 11) == 2) ? i + 10 : 0;
46 asm volatile ("" : "+g" (i));
47 b[i] = ((i % 13) == 5) ? i * 2 : 0;
49 #pragma omp parallel
50 foo (a);
51 if (x != 133)
52 __builtin_abort ();
53 x = -3;
54 #pragma omp parallel
55 bar (b, a);
56 if (x != 244 || v != 143)
57 __builtin_abort ();
58 #pragma omp parallel
59 baz (b);
60 if (x != 249)
61 __builtin_abort ();
62 return 0;