From: Thomas Schwinge Date: Thu, 29 Oct 2015 09:03:40 +0000 (+0100) Subject: Improve filenames for test cases of OpenACC combined directives X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=41e977ac9054519259a7740d0f4b434105cd366a;p=gcc.git Improve filenames for test cases of OpenACC combined directives libgomp/ * testsuite/libgomp.oacc-c-c++-common/combdir-1.c: Rename to... * testsuite/libgomp.oacc-c-c++-common/combined-directives-1.c: ... this. Add a description of the test at the top of the file. * testsuite/libgomp.oacc-fortran/combdir-1.f90: Rename file to... * testsuite/libgomp.oacc-fortran/combined-directives-1.f90: ... this. Add a description of the test at the top of the file. Co-Authored-By: Cesar Philippidis From-SVN: r229518 --- diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index 8f44af02606..c78881b2b62 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,13 @@ +2015-10-29 Thomas Schwinge + Cesar Philippidis + + * testsuite/libgomp.oacc-c-c++-common/combdir-1.c: Rename to... + * testsuite/libgomp.oacc-c-c++-common/combined-directives-1.c: + ... this. Add a description of the test at the top of the file. + * testsuite/libgomp.oacc-fortran/combdir-1.f90: Rename file to... + * testsuite/libgomp.oacc-fortran/combined-directives-1.f90: + ... this. Add a description of the test at the top of the file. + 2015-10-28 Nathan Sidwell * testsuite/libgomp.oacc-c-c++-common/loop-g-1.c: New. diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/combdir-1.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/combdir-1.c deleted file mode 100644 index a7def920b94..00000000000 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/combdir-1.c +++ /dev/null @@ -1,52 +0,0 @@ -/* { dg-do run } */ - -#include - -int -main (int argc, char **argv) -{ - const int N = 32; - float a[N], b[N]; - int i; - - for (i = 0; i < N; i++) - { - a[i] = 1.0; - b[i] = 0.0; - } - -#pragma acc parallel loop copy (a[0:N]) copy (b[0:N]) - for (i = 0; i < N; i++) - { - b[i] = 2.0; - a[i] = a[i] + b[i]; - } - - for (i = 0; i < N; i++) - { - if (a[i] != 3.0) - abort (); - - if (b[i] != 2.0) - abort (); - } - -#pragma acc kernels loop copy (a[0:N]) copy (b[0:N]) - for (i = 0; i < N; i++) - { - b[i] = 3.0; - a[i] = a[i] + b[i]; - } - - for (i = 0; i < N; i++) - { - if (a[i] != 6.0) - abort (); - - if (b[i] != 3.0) - abort (); - } - - return 0; - -} diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/combined-directives-1.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/combined-directives-1.c new file mode 100644 index 00000000000..dad6d13eb60 --- /dev/null +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/combined-directives-1.c @@ -0,0 +1,54 @@ +/* This test exercises combined directives. */ + +/* { dg-do run } */ + +#include + +int +main (int argc, char **argv) +{ + const int N = 32; + float a[N], b[N]; + int i; + + for (i = 0; i < N; i++) + { + a[i] = 1.0; + b[i] = 0.0; + } + +#pragma acc parallel loop copy (a[0:N]) copy (b[0:N]) + for (i = 0; i < N; i++) + { + b[i] = 2.0; + a[i] = a[i] + b[i]; + } + + for (i = 0; i < N; i++) + { + if (a[i] != 3.0) + abort (); + + if (b[i] != 2.0) + abort (); + } + +#pragma acc kernels loop copy (a[0:N]) copy (b[0:N]) + for (i = 0; i < N; i++) + { + b[i] = 3.0; + a[i] = a[i] + b[i]; + } + + for (i = 0; i < N; i++) + { + if (a[i] != 6.0) + abort (); + + if (b[i] != 3.0) + abort (); + } + + return 0; + +} diff --git a/libgomp/testsuite/libgomp.oacc-fortran/combdir-1.f90 b/libgomp/testsuite/libgomp.oacc-fortran/combdir-1.f90 deleted file mode 100644 index 0cd8a670abb..00000000000 --- a/libgomp/testsuite/libgomp.oacc-fortran/combdir-1.f90 +++ /dev/null @@ -1,37 +0,0 @@ -! { dg-do run } - -program main - integer, parameter :: n = 32 - real :: a(n), b(n); - integer :: i - - do i = 1, n - a(i) = 1.0 - b(i) = 0.0 - end do - - !$acc parallel loop copy (a(1:n)) copy (b(1:n)) - do i = 1, n - b(i) = 2.0 - a(i) = a(i) + b(i) - end do - - do i = 1, n - if (a(i) .ne. 3.0) call abort - - if (b(i) .ne. 2.0) call abort - end do - - !$acc kernels loop copy (a(1:n)) copy (b(1:n)) - do i = 1, n - b(i) = 3.0; - a(i) = a(i) + b(i) - end do - - do i = 1, n - if (a(i) .ne. 6.0) call abort - - if (b(i) .ne. 3.0) call abort - end do - -end program main diff --git a/libgomp/testsuite/libgomp.oacc-fortran/combined-directives-1.f90 b/libgomp/testsuite/libgomp.oacc-fortran/combined-directives-1.f90 new file mode 100644 index 00000000000..94100b22163 --- /dev/null +++ b/libgomp/testsuite/libgomp.oacc-fortran/combined-directives-1.f90 @@ -0,0 +1,39 @@ +! This test exercises combined directives. + +! { dg-do run } + +program main + integer, parameter :: n = 32 + real :: a(n), b(n); + integer :: i + + do i = 1, n + a(i) = 1.0 + b(i) = 0.0 + end do + + !$acc parallel loop copy (a(1:n)) copy (b(1:n)) + do i = 1, n + b(i) = 2.0 + a(i) = a(i) + b(i) + end do + + do i = 1, n + if (a(i) .ne. 3.0) call abort + + if (b(i) .ne. 2.0) call abort + end do + + !$acc kernels loop copy (a(1:n)) copy (b(1:n)) + do i = 1, n + b(i) = 3.0; + a(i) = a(i) + b(i) + end do + + do i = 1, n + if (a(i) .ne. 6.0) call abort + + if (b(i) .ne. 3.0) call abort + end do + +end program main