gcc/libgomp/testsuite/libgomp.c/static-chunk-size-one.c
Tom de Vries 6be5c241bb Optimize expand_omp_for_static_chunk for chunk_size one
2015-08-24  Tom de Vries  <tom@codesourcery.com>

	PR tree-optimization/65468
	* omp-low.c (expand_omp_for_static_chunk): Remove inner loop if
	chunk_size is one.

	* gcc.dg/gomp/static-chunk-size-one.c: New test.

	* testsuite/libgomp.c/static-chunk-size-one.c: New test.

From-SVN: r227124
2015-08-24 13:14:17 +00:00

24 lines
275 B
C

extern void abort ();
int
bar ()
{
int a = 0, i;
#pragma omp parallel for num_threads (3) reduction (+:a) schedule(static, 1)
for (i = 0; i < 10; i++)
a += i;
return a;
}
int
main (void)
{
int res;
res = bar ();
if (res != 45)
abort ();
return 0;
}