summaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.fortran/character1.f90
diff options
context:
space:
mode:
authorupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
committerupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
commit554fd8c5195424bdbcabf5de30fdc183aba391bd (patch)
tree976dc5ab7fddf506dadce60ae936f43f58787092 /libgomp/testsuite/libgomp.fortran/character1.f90
downloadcbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2
cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.xz
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository.
Diffstat (limited to 'libgomp/testsuite/libgomp.fortran/character1.f90')
-rw-r--r--libgomp/testsuite/libgomp.fortran/character1.f9072
1 files changed, 72 insertions, 0 deletions
diff --git a/libgomp/testsuite/libgomp.fortran/character1.f90 b/libgomp/testsuite/libgomp.fortran/character1.f90
new file mode 100644
index 000000000..f75ae27e8
--- /dev/null
+++ b/libgomp/testsuite/libgomp.fortran/character1.f90
@@ -0,0 +1,72 @@
+! { dg-do run }
+!$ use omp_lib
+
+ character (len = 8) :: h, i
+ character (len = 4) :: j, k
+ h = '01234567'
+ i = 'ABCDEFGH'
+ j = 'IJKL'
+ k = 'MN'
+ call test (h, j)
+contains
+ subroutine test (p, q)
+ character (len = 8) :: p
+ character (len = 4) :: q, r
+ character (len = 16) :: f
+ character (len = 32) :: g
+ integer, dimension (18) :: s
+ logical :: l
+ integer :: m
+ f = 'test16'
+ g = 'abcdefghijklmnopqrstuvwxyz'
+ r = ''
+ l = .false.
+ s = -6
+!$omp parallel firstprivate (f, p, s) private (r, m) reduction (.or.:l) &
+!$omp & num_threads (4)
+ m = omp_get_thread_num ()
+ if (any (s .ne. -6)) l = .true.
+ l = l .or. f .ne. 'test16' .or. p .ne. '01234567'
+ l = l .or. g .ne. 'abcdefghijklmnopqrstuvwxyz'
+ l = l .or. i .ne. 'ABCDEFGH' .or. q .ne. 'IJKL'
+ l = l .or. k .ne. 'MN'
+!$omp barrier
+ if (m .eq. 0) then
+ f = 'ffffffff0'
+ g = 'xyz'
+ i = '123'
+ k = '9876'
+ p = '_abc'
+ q = '_def'
+ r = '1_23'
+ else if (m .eq. 1) then
+ f = '__'
+ p = 'xxx'
+ r = '7575'
+ else if (m .eq. 2) then
+ f = 'ZZ'
+ p = 'm2'
+ r = 'M2'
+ else if (m .eq. 3) then
+ f = 'YY'
+ p = 'm3'
+ r = 'M3'
+ end if
+ s = m
+!$omp barrier
+ l = l .or. g .ne. 'xyz' .or. i .ne. '123' .or. k .ne. '9876'
+ l = l .or. q .ne. '_def'
+ if (any (s .ne. m)) l = .true.
+ if (m .eq. 0) then
+ l = l .or. f .ne. 'ffffffff0' .or. p .ne. '_abc' .or. r .ne. '1_23'
+ else if (m .eq. 1) then
+ l = l .or. f .ne. '__' .or. p .ne. 'xxx' .or. r .ne. '7575'
+ else if (m .eq. 2) then
+ l = l .or. f .ne. 'ZZ' .or. p .ne. 'm2' .or. r .ne. 'M2'
+ else if (m .eq. 3) then
+ l = l .or. f .ne. 'YY' .or. p .ne. 'm3' .or. r .ne. 'M3'
+ end if
+!$omp end parallel
+ if (l) call abort
+ end subroutine test
+end