1 /* Test that all sections are touched. */
3 /* { dg-require-effective-target sync_int_long } */
15 static void clean_data (void)
17 memset (data
, -1, sizeof (data
));
20 static void test_data (void)
24 for (i
= 0; i
< N
; ++i
)
25 assert (data
[i
] != -1);
28 static void set_data (unsigned i
, int val
)
31 assert (i
>= 1 && i
<= N
);
32 old
= __sync_lock_test_and_set (data
+i
-1, val
);
37 static void f_1 (void *dummy
)
39 int iam
= omp_get_thread_num ();
42 for (s
= GOMP_sections_start (N
); s
; s
= GOMP_sections_next ())
47 static void test_1 (void)
50 GOMP_parallel_start (f_1
, NULL
, NTHR
);
56 static void f_2 (void *dummy
)
58 int iam
= omp_get_thread_num ();
61 while ((s
= GOMP_sections_next ()))
63 GOMP_sections_end_nowait ();
66 static void test_2 (void)
69 GOMP_parallel_sections_start (f_2
, NULL
, NTHR
, N
);