diff options
author | vries <vries@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-03-27 12:10:16 +0000 |
---|---|---|
committer | vries <vries@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-03-27 12:10:16 +0000 |
commit | 2a4e8fbdb94dc8a6836b23d15c1c967a780ea3c0 (patch) | |
tree | aa08b4e13b23d4c441ee166f0a962f80265e5f3e /libgomp | |
parent | 7e1b49763289d35307c5630722227e91bc9d2de5 (diff) | |
download | gcc-2a4e8fbdb94dc8a6836b23d15c1c967a780ea3c0.tar.gz |
Add verification to libgomp.graphite/force-parallel-6.c
2015-03-27 Tom de Vries <tom@codesourcery.com>
PR testsuite/65594
* testsuite/libgomp.graphite/force-parallel-6.c (abort): Declare.
(init, check): New function.
(foo): Change return type to void.
(main): Call init and check.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@221728 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgomp')
-rw-r--r-- | libgomp/ChangeLog | 8 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.graphite/force-parallel-6.c | 52 |
2 files changed, 57 insertions, 3 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index f9ea0544c5f..b2e7892b0ef 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,6 +1,14 @@ 2015-03-27 Tom de Vries <tom@codesourcery.com> PR testsuite/65594 + * testsuite/libgomp.graphite/force-parallel-6.c (abort): Declare. + (init, check): New function. + (foo): Change return type to void. + (main): Call init and check. + +2015-03-27 Tom de Vries <tom@codesourcery.com> + + PR testsuite/65594 * testsuite/libgomp.graphite/force-parallel-6.c (M): Define. (foo): Use M for non-inner loops to scale down test-case. diff --git a/libgomp/testsuite/libgomp.graphite/force-parallel-6.c b/libgomp/testsuite/libgomp.graphite/force-parallel-6.c index e9e4b562488..cbc57357b33 100644 --- a/libgomp/testsuite/libgomp.graphite/force-parallel-6.c +++ b/libgomp/testsuite/libgomp.graphite/force-parallel-6.c @@ -1,10 +1,31 @@ +void abort (void); + #define N 500 #define M 50 int X[2*N], Y[2*N], B[2*N]; int A[2*N][2*N], C[2*N][2*N]; -int foo(void) +static void __attribute__((noinline,noclone)) +init (void) +{ + volatile int i, j; + + for (i = 0; i < 2 * N; ++i) + { + B[i] = 1; + X[i] = 1; + Y[i] = 1; + for (j = 0; j < 2 * N; ++j) + { + A[i][j] = 1; + C[i][j] = 1; + } + } +} + +static void __attribute__((noinline,noclone)) +foo (void) { int i, j, k; @@ -21,13 +42,38 @@ int foo(void) Y[i+j] = A[j+1][N]; } } +} - return A[1][5]*B[6]; +static void __attribute__((noinline,noclone)) +check (void) +{ + volatile int i, j; + + for (i = 0; i < 2 * N; ++i) + { + int expect_x = i < M ? 11 : 1; + + if (B[i] != 1 + || X[i] != expect_x + || Y[i] != 1) + abort (); + + for (j = 0; j < 2 * N; ++j) + { + int expect_a = (0 < i && i <= M && j < N) ? 2 : 1; + + if (A[i][j] != expect_a + || C[i][j] != 1) + abort (); + } + } } int main(void) { - foo(); + init (); + foo (); + check (); return 0; } |