URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libgomp/] [testsuite/] [libgomp.fortran/] [omp_parse2.f90] - Rev 735
Compare with Previous | Blame | View Log
! { dg-do run }use omp_libcall test_mastercall test_criticalcall test_barriercall test_atomiccontainssubroutine test_masterlogical :: i, ji = .false.j = .false.!$omp parallel num_threads (4)!$omp masteri = .true.j = omp_get_thread_num () .eq. 0!$omp endmaster!$omp end parallelif (.not. (i .or. j)) call abortend subroutine test_mastersubroutine test_critical_1 (i, j)integer :: i, j!$omp critical(critical_foo)i = i + 1!$omp end critical (critical_foo)!$omp criticalj = j + 1!$omp end criticalend subroutine test_critical_1subroutine test_criticalinteger :: i, j, nn = -1i = 0j = 0!$omp parallel num_threads (4)if (omp_get_thread_num () .eq. 0) n = omp_get_num_threads ()call test_critical_1 (i, j)call test_critical_1 (i, j)!$omp criticalj = j + 1!$omp end critical!$omp critical (critical_foo)i = i + 1!$omp endcritical (critical_foo)!$omp end parallelif (n .lt. 1 .or. i .ne. n * 3 .or. j .ne. n * 3) call abortend subroutine test_criticalsubroutine test_barrierinteger :: ilogical :: ji = 23j = .false.!$omp parallel num_threads (4)if (omp_get_thread_num () .eq. 0) i = 5!$omp flush (i)!$omp barrierif (i .ne. 5) then!$omp atomicj = j .or. .true.end if!$omp end parallelif (i .ne. 5 .or. j) call abortend subroutine test_barriersubroutine test_atomicinteger :: a, b, c, d, e, f, ga = 0b = 1c = 0d = 1024e = 1024f = -1g = -1!$omp parallel num_threads (8)!$omp atomica = a + 2 + 4!$omp atomicb = 3 * b!$omp atomicc = 8 - c!$omp atomicd = d / 2!$omp atomice = min (e, omp_get_thread_num ())!$omp atomicf = max (omp_get_thread_num (), f)if (omp_get_thread_num () .eq. 0) g = omp_get_num_threads ()!$omp end parallelif (g .le. 0 .or. g .gt. 8) call abortif (a .ne. 6 * g .or. b .ne. 3 ** g) call abortif (iand (g, 1) .eq. 1) thenif (c .ne. 8) call abortelse if (c .ne. 0) thencall abortend ifif (d .ne. 1024 / (2 ** g)) call abortif (e .ne. 0 .or. f .ne. g - 1) call abortend subroutine test_atomicend
