diff options
author | Tom de Vries <tom@codesourcery.com> | 2015-06-13 08:05:54 +0000 |
---|---|---|
committer | Tom de Vries <tom@codesourcery.com> | 2015-06-13 08:05:54 +0000 |
commit | c0571767a82fc653cbee952af6703b2ee39e2e1d (patch) | |
tree | 36fd31ec1cf7c4432aa7fde0ccad445724213a8b /libgomp/testsuite/libgomp.c | |
parent | f7b804e48dd2a503bb120991822ab98b3c8dc72c (diff) |
Add gcc.dg/parloops-exit-first-loop-alt-4.c
2015-06-13 Tom de Vries <tom@codesourcery.com>
* gcc.dg/parloops-exit-first-loop-alt-4.c: New test.
* testsuite/libgomp.c/parloops-exit-first-loop-alt-4.c: New test.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@224453 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgomp/testsuite/libgomp.c')
-rw-r--r-- | libgomp/testsuite/libgomp.c/parloops-exit-first-loop-alt-4.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/libgomp/testsuite/libgomp.c/parloops-exit-first-loop-alt-4.c b/libgomp/testsuite/libgomp.c/parloops-exit-first-loop-alt-4.c new file mode 100644 index 00000000000..1beae3eb11c --- /dev/null +++ b/libgomp/testsuite/libgomp.c/parloops-exit-first-loop-alt-4.c @@ -0,0 +1,33 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -ftree-parallelize-loops=2" } */ + +/* Constant bound, reduction. */ + +#define N 4000 + +unsigned int *a; + +unsigned int +f (void) +{ + int i; + unsigned int sum = 1; + + for (i = 0; i < N; ++i) + sum += a[i]; + + return sum; +} + +int +main (void) +{ + unsigned int res; + unsigned int array[N]; + int i; + for (i = 0; i < N; ++i) + array[i] = i % 7; + a = &array[0]; + res = f (); + return !(res == 11995); +} |