diff --git a/Parser/test-data/OpenAcc/atomic.f b/Parser/test-data/OpenAcc/atomic.f index da00ba64617dffa536646a5f97fee5d071829945..502004749043bb49ea0ae5985c35cb0527c967fc 100644 --- a/Parser/test-data/OpenAcc/atomic.f +++ b/Parser/test-data/OpenAcc/atomic.f @@ -1,22 +1,24 @@ -!$acc atomic -x = 1 -!$acc end atomic +! acc atomic directive (2.12) -!$acc atomic read -x = 1 -!$acc end atomic + !$acc atomic + x = 1 + !$acc end atomic -!$acc atomic write -x = 1 -!$acc end atomic + !$acc atomic read + x = 1 + !$acc end atomic -!$acc atomic update -x = 1 -!$acc end atomic + !$acc atomic write + x = 1 + !$acc end atomic -!$acc atomic capture -x = 1 -x = 1 -!$acc end atomic + !$acc atomic update + x = 1 + !$acc end atomic -end + !$acc atomic capture + x = 1 + x = 1 + !$acc end atomic + +end program diff --git a/Parser/test-data/OpenAcc/cache.f b/Parser/test-data/OpenAcc/cache.f index e07e60bd946923173fc7c0d346d49064cf75ce8a..6788dc3a213963b3d9aebc8c785f78dcd47ba8b2 100644 --- a/Parser/test-data/OpenAcc/cache.f +++ b/Parser/test-data/OpenAcc/cache.f @@ -1,6 +1,7 @@ +! cache directive (2.10) -!$acc cache(a,b,c) + !$acc cache(a,b,c) -!$acc cache(x) + !$acc cache(x) end diff --git a/Parser/test-data/OpenAcc/clauses.f b/Parser/test-data/OpenAcc/clauses.f index ef969e27bda97c5bc270df28f15b2b60e18ba259..5daf9e9fc9fb78cfbec161b7dd949cf31df9b1fa 100644 --- a/Parser/test-data/OpenAcc/clauses.f +++ b/Parser/test-data/OpenAcc/clauses.f @@ -1,261 +1,265 @@ -! if =========================================================================== +! OpenACC clause test -!$acc parallel if(1) -x = 1 -!$acc end parallel + x = 0 -!$acc parallel if(a) -x = 1 -!$acc end parallel + ! if =========================================================================== -!$acc parallel if(a + 1) -x = 1 -!$acc end parallel + !$acc parallel if(1) + x = 1 + !$acc end parallel -!$acc parallel if(a%b) -x = 1 -!$acc end parallel + !$acc parallel if(a) + x = 1 + !$acc end parallel -!$acc parallel if(a(1,2)) -x = 1 -!$acc end parallel + !$acc parallel if(a + 1) + x = 1 + !$acc end parallel -! default(none) ================================================================ + !$acc parallel if(a%b) + x = 1 + !$acc end parallel -!$acc parallel default(none) -x = 1 -!$acc end parallel + !$acc parallel if(a(1,2)) + x = 1 + !$acc end parallel -! device type ================================================================== + ! default(none) ================================================================ -!$acc parallel device_type(t1) -x = 1 -!$acc end parallel + !$acc parallel default(none) + x = 1 + !$acc end parallel -!$acc parallel device_type(t1,t2) -x = 1 -!$acc end parallel + ! device type ================================================================== -!$acc parallel device_type(*) -x = 1 -!$acc end parallel + !$acc parallel device_type(t1) + x = 1 + !$acc end parallel -! short versions are expanded + !$acc parallel device_type(t1,t2) + x = 1 + !$acc end parallel -! !$acc parallel dtype(t1) -! x = 1 -! !$acc end parallel + !$acc parallel device_type(*) + x = 1 + !$acc end parallel -! !$acc parallel dtype(t1,t2) -! x = 1 -! !$acc end parallel + ! short versions are expanded -! !$acc parallel dtype(*) -! x = 1 -! !$acc end parallel + ! !$acc parallel dtype(t1) + ! x = 1 + ! !$acc end parallel -! tile ========================================================================= + ! !$acc parallel dtype(t1,t2) + ! x = 1 + ! !$acc end parallel -!$acc loop tile(myTile) -do i = 1, n(5) - x = 1 -end do -!$acc end loop + ! !$acc parallel dtype(*) + ! x = 1 + ! !$acc end parallel -! wait ========================================================================= + ! tile ========================================================================= -!$acc parallel wait(x + 1,2,y) -x = 1 -!$acc end parallel + !$acc loop tile(myTile) + do i = 1,n(5) + x = 1 + end do + !$acc end loop -! collapse ===================================================================== + ! wait ========================================================================= -!$acc loop collapse(4) -do i = 1, n(5) + !$acc parallel wait(x + 1,2,y) x = 1 -end do -!$acc end loop + !$acc end parallel -!$acc loop collapse(0) -do i = 1, n(5) - x = 1 -end do -!$acc end loop + ! collapse ===================================================================== -!$acc loop collapse(#TEST#) -do i = 1, n(5) - x = 1 -end do -!$acc end loop + !$acc loop collapse(4) + do i = 1,n(5) + x = 1 + end do + !$acc end loop -! expression clauses =========================================================== + !$acc loop collapse(0) + do i = 1,n(5) + x = 1 + end do + !$acc end loop -!$acc parallel async(1 + x) -x = 1 -!$acc end parallel + !$acc loop collapse(#TEST#) + do i = 1,n(5) + x = 1 + end do + !$acc end loop -!$acc parallel num_gangs(1 + x) -x = 1 -!$acc end parallel + ! expression clauses =========================================================== -!$acc parallel num_workers(1 + x) -x = 1 -!$acc end parallel + !$acc parallel async(1 + x) + x = 1 + !$acc end parallel -!$acc parallel vector_length(1 + x) -x = 1 -!$acc end parallel + !$acc parallel num_gangs(1 + x) + x = 1 + !$acc end parallel -! reduction ==================================================================== + !$acc parallel num_workers(1 + x) + x = 1 + !$acc end parallel -! operators + !$acc parallel vector_length(1 + x) + x = 1 + !$acc end parallel + + ! reduction ==================================================================== -!$acc parallel reduction(+:x) -x = 1 -!$acc end parallel + ! operators + + !$acc parallel reduction(+:x) + x = 1 + !$acc end parallel -!$acc parallel reduction(*:x) -x = 1 -!$acc end parallel + !$acc parallel reduction(*:x) + x = 1 + !$acc end parallel -!$acc parallel reduction(max:x) -x = 1 -!$acc end parallel + !$acc parallel reduction(max:x) + x = 1 + !$acc end parallel -!$acc parallel reduction(min:x) -x = 1 -!$acc end parallel + !$acc parallel reduction(min:x) + x = 1 + !$acc end parallel -!$acc parallel reduction(iand:x) -x = 1 -!$acc end parallel + !$acc parallel reduction(iand:x) + x = 1 + !$acc end parallel -!$acc parallel reduction(ior:x) -x = 1 -!$acc end parallel + !$acc parallel reduction(ior:x) + x = 1 + !$acc end parallel -!$acc parallel reduction(ieor:x) -x = 1 -!$acc end parallel + !$acc parallel reduction(ieor:x) + x = 1 + !$acc end parallel -!$acc parallel reduction(.and.:x) -x = 1 -!$acc end parallel + !$acc parallel reduction(.and.:x) + x = 1 + !$acc end parallel -!$acc parallel reduction(.or.:x) -x = 1 -!$acc end parallel + !$acc parallel reduction(.or.:x) + x = 1 + !$acc end parallel -!$acc parallel reduction(.eqv.:x) -x = 1 -!$acc end parallel + !$acc parallel reduction(.eqv.:x) + x = 1 + !$acc end parallel -!$acc parallel reduction(.neqv.:x) -x = 1 -!$acc end parallel + !$acc parallel reduction(.neqv.:x) + x = 1 + !$acc end parallel -! variabes + ! variabes -!$acc parallel reduction(+:x,y,z) -x = 1 -!$acc end parallel + !$acc parallel reduction(+:x,y,z) + x = 1 + !$acc end parallel -! variable list clauses ======================================================== + ! variable list clauses ======================================================== -!$acc enter data copy(x,y,z) -!$acc enter data copyin(x,y) -!$acc enter data copyout(x) -!$acc enter data create(x) -!$acc enter data delete(x) -!$acc enter data device(x) -!$acc enter data firstprivate(x) -!$acc enter data host(x) -!$acc enter data present(x) -!$acc enter data present_or_copy(x) -!$acc enter data present_or_copyin(x) -!$acc enter data present_or_copyout(x) -!$acc enter data present_or_create(x) -!$acc enter data private(x) -!$acc enter data self(x) -!$acc enter data use_device(x) + !$acc enter data copy(x,y,z) + !$acc enter data copyin(x,y) + !$acc enter data copyout(x) + !$acc enter data create(x) + !$acc enter data delete(x) + !$acc enter data device(x) + !$acc enter data firstprivate(x) + !$acc enter data host(x) + !$acc enter data present(x) + !$acc enter data present_or_copy(x) + !$acc enter data present_or_copyin(x) + !$acc enter data present_or_copyout(x) + !$acc enter data present_or_create(x) + !$acc enter data private(x) + !$acc enter data self(x) + !$acc enter data use_device(x) -! short versions are expanded -! !$acc enter data pcopy(x) -! !$acc enter data pcopyin(x) -! !$acc enter data pcopyout(x) -! !$acc enter data pcreate(x) + ! short versions are expanded + ! !$acc enter data pcopy(x) + ! !$acc enter data pcopyin(x) + ! !$acc enter data pcopyout(x) + ! !$acc enter data pcreate(x) -! loop clauses ================================================================= + ! loop clauses ================================================================= -!$acc loop gang -do i = 1, n(5) - x = 1 -end do -!$acc end loop + !$acc loop gang + do i = 1,n(5) + x = 1 + end do + !$acc end loop -!$acc loop worker -do i = 1, n(5) - x = 1 -end do -!$acc end loop + !$acc loop worker + do i = 1,n(5) + x = 1 + end do + !$acc end loop -!$acc loop vector -do i = 1, n(5) - x = 1 -end do -!$acc end loop + !$acc loop vector + do i = 1,n(5) + x = 1 + end do + !$acc end loop -!$acc loop independent -do i = 1, n(5) - x = 1 -end do -!$acc end loop + !$acc loop independent + do i = 1,n(5) + x = 1 + end do + !$acc end loop -!$acc loop gang(3) -do i = 1, n(5) - x = 1 -end do -!$acc end loop + !$acc loop gang(3) + do i = 1,n(5) + x = 1 + end do + !$acc end loop -!$acc loop worker(3) -do i = 1, n(5) - x = 1 -end do -!$acc end loop + !$acc loop worker(3) + do i = 1,n(5) + x = 1 + end do + !$acc end loop -!$acc loop vector(3) -do i = 1, n(5) - x = 1 -end do -!$acc end loop + !$acc loop vector(3) + do i = 1,n(5) + x = 1 + end do + !$acc end loop -!$acc loop shortloop -do i = 1, n(5) - x = 1 -end do -!$acc end loop + !$acc loop shortloop + do i = 1,n(5) + x = 1 + end do + !$acc end loop -! seq ========================================================================== + ! seq ========================================================================== -!$acc routine(myRoutine) seq + !$acc routine(myRoutine) seq -! bind ========================================================================= + ! bind ========================================================================= -!$acc routine(myRoutine) bind(aName) + !$acc routine(myRoutine) bind(aName) -!$acc routine(myRoutine) bind("some string...! x = 1") + !$acc routine(myRoutine) bind('some string...! x = 1') -! nohost ======================================================================= + ! nohost ======================================================================= -!$acc routine nohost + !$acc routine nohost -! device_resident ============================================================== + ! device_resident ============================================================== -!$acc declare device_resident(x,y,z) + !$acc declare device_resident(x,y,z) -! link ========================================================================= + ! link ========================================================================= -!$acc declare link(x,y,z) + !$acc declare link(x,y,z) end diff --git a/Parser/test-data/OpenAcc/data.f b/Parser/test-data/OpenAcc/data.f index ca291536b8f4740fa50dc657fdf7706f018074bf..5e9ecc3f3b3b0250c1863ffe9f1d5c426b03515b 100644 --- a/Parser/test-data/OpenAcc/data.f +++ b/Parser/test-data/OpenAcc/data.f @@ -1,24 +1,24 @@ -!$acc data -x = 1 -!$acc end data + !$acc data + x = 1 + !$acc end data -!$acc data -!$acc data -x = 1 -!$acc end data -!$acc end data + !$acc data + !$acc data + x = 1 + !$acc end data + !$acc end data -!$acc data if(1) -x = 1 -!$acc end data + !$acc data if(1) + x = 1 + !$acc end data -!$acc data if(a) -x = 1 -!$acc end data + !$acc data if(a) + x = 1 + !$acc end data -!$acc data present(T,r,f,stiffness_mat,global_mass_inv,mass_mat_diag) -x = 1 -!$acc end data + !$acc data present(T,r,f,stiffness_mat,global_mass_inv,mass_mat_diag) + x = 1 + !$acc end data end diff --git a/Parser/test-data/OpenAcc/declare.f b/Parser/test-data/OpenAcc/declare.f index c30bc5b567c4932a05593c64a7012d1928601269..b3e571893e293aea23d6ea4ad84ad9e588a08ff7 100644 --- a/Parser/test-data/OpenAcc/declare.f +++ b/Parser/test-data/OpenAcc/declare.f @@ -1,5 +1,6 @@ -!$acc declare -!$acc declare if(x) + !$acc declare + + !$acc declare if(x) end diff --git a/Parser/test-data/OpenAcc/enter_data.f b/Parser/test-data/OpenAcc/enter_data.f index 1b9b300c17c08e885983cc7fbff208fc4b257eb9..05feed350f7560887994f31956b733145c9b68ce 100644 --- a/Parser/test-data/OpenAcc/enter_data.f +++ b/Parser/test-data/OpenAcc/enter_data.f @@ -1,6 +1,6 @@ -!$acc enter data + !$acc enter data -!$acc enter data if(1) + !$acc enter data if(1) end diff --git a/Parser/test-data/OpenAcc/exit_data.f b/Parser/test-data/OpenAcc/exit_data.f index 28d7b5d00d5ed74983ed1603bc574f789a904737..8e5ddba7816742e2c2d8e428b16bccda87e8be69 100644 --- a/Parser/test-data/OpenAcc/exit_data.f +++ b/Parser/test-data/OpenAcc/exit_data.f @@ -1,6 +1,6 @@ -!$acc exit data + !$acc exit data -!$acc exit data if(1) + !$acc exit data if(1) end diff --git a/Parser/test-data/OpenAcc/host_data.f b/Parser/test-data/OpenAcc/host_data.f index 1fb07e08769ea3af1f847a5582c29de3e4ead275..79ff38f13cae9bf79afcb2a6817362e437292344 100644 --- a/Parser/test-data/OpenAcc/host_data.f +++ b/Parser/test-data/OpenAcc/host_data.f @@ -1,20 +1,20 @@ -!$acc host_data -x = 1 -!$acc end host_data + !$acc host_data + x = 1 + !$acc end host_data -!$acc host_data -!$acc host_data -x = 1 -!$acc end host_data -!$acc end host_data + !$acc host_data + !$acc host_data + x = 1 + !$acc end host_data + !$acc end host_data -!$acc host_data if(1) -x = 1 -!$acc end host_data + !$acc host_data if(1) + x = 1 + !$acc end host_data -!$acc host_data if(a) -x = 1 -!$acc end host_data + !$acc host_data if(a) + x = 1 + !$acc end host_data end diff --git a/Parser/test-data/OpenAcc/kernels.f b/Parser/test-data/OpenAcc/kernels.f index a2480a51574ffd8d6f270a283a43512da1cf09cc..dd27d00725b321f338d48a6e393023d54a7bf68b 100644 --- a/Parser/test-data/OpenAcc/kernels.f +++ b/Parser/test-data/OpenAcc/kernels.f @@ -1,20 +1,20 @@ -!$acc kernels -x = 1 -!$acc end kernels + !$acc kernels + x = 1 + !$acc end kernels -!$acc kernels -!$acc kernels -x = 1 -!$acc end kernels -!$acc end kernels + !$acc kernels + !$acc kernels + x = 1 + !$acc end kernels + !$acc end kernels -!$acc kernels if(1) -x = 1 -!$acc end kernels + !$acc kernels if(1) + x = 1 + !$acc end kernels -!$acc kernels if(a) -x = 1 -!$acc end kernels + !$acc kernels if(a) + x = 1 + !$acc end kernels end diff --git a/Parser/test-data/OpenAcc/loop.f b/Parser/test-data/OpenAcc/loop.f index 050a2227b0a28b05b6f0437ec66c91868af46d79..ae318672201f0e9370bef01beee849693730058b 100644 --- a/Parser/test-data/OpenAcc/loop.f +++ b/Parser/test-data/OpenAcc/loop.f @@ -1,59 +1,58 @@ - -do i = 1, n(5) - x = 1 -end do - -!$acc loop -do i = 1, n(5) - x = 1 -end do -!$acc end loop - -!$acc loop -!$acc loop -do i = 1, n(5) - x = 1 -end do -!$acc end loop -!$acc end loop - -!$acc kernels loop -do i = 1, n(5) - x = 1 -end do -!$acc end kernels loop - -!$acc parallel loop -do i = 1, n(5) - x = 1 -end do -!$acc end parallel loop - -!$acc parallel loop vector -do i = 1, n(5) - x = 1 -end do -!$acc end parallel loop - -!$acc parallel loop vector gang -do i = 1, n(5) - x = 1 -end do -!$acc end parallel loop - -! !$acc parallel loop vector,gang -!$acc parallel loop vector gang -do i = 1, n(5) - x = 1 -end do -!$acc end parallel loop - -! !$acc parallel loop vector , gang -!$acc parallel loop vector gang -do i = 1, n(5) - x = 1 -end do -!$acc end parallel loop + do i = 1, n(5) + x = 1 + end do + + !$acc loop + do i = 1, n(5) + x = 1 + end do + !$acc end loop + + !$acc loop + !$acc loop + do i = 1, n(5) + x = 1 + end do + !$acc end loop + !$acc end loop + + !$acc kernels loop + do i = 1, n(5) + x = 1 + end do + !$acc end kernels loop + + !$acc parallel loop + do i = 1, n(5) + x = 1 + end do + !$acc end parallel loop + + !$acc parallel loop vector + do i = 1, n(5) + x = 1 + end do + !$acc end parallel loop + + !$acc parallel loop vector gang + do i = 1, n(5) + x = 1 + end do + !$acc end parallel loop + + ! !$acc parallel loop vector,gang + !$acc parallel loop vector gang + do i = 1, n(5) + x = 1 + end do + !$acc end parallel loop + + ! !$acc parallel loop vector , gang + !$acc parallel loop vector gang + do i = 1, n(5) + x = 1 + end do + !$acc end parallel loop end diff --git a/Parser/test-data/OpenAcc/parallel.f b/Parser/test-data/OpenAcc/parallel.f index b7e3c2f5c861c5fac7fabda4cbc513b7877fb344..48713e97cffa55d4eef2d199ed6e0d7a3b86a370 100644 --- a/Parser/test-data/OpenAcc/parallel.f +++ b/Parser/test-data/OpenAcc/parallel.f @@ -1,20 +1,20 @@ -!$acc parallel -x = 1 -!$acc end parallel + !$acc parallel + x = 1 + !$acc end parallel -!$acc parallel -!$acc parallel -x = 1 -!$acc end parallel -!$acc end parallel + !$acc parallel + !$acc parallel + x = 1 + !$acc end parallel + !$acc end parallel -!$acc parallel if(1) -x = 1 -!$acc end parallel + !$acc parallel if(1) + x = 1 + !$acc end parallel -!$acc parallel if(a) -x = 1 -!$acc end parallel + !$acc parallel if(a) + x = 1 + !$acc end parallel end diff --git a/Parser/test-data/OpenAcc/rewrites.f b/Parser/test-data/OpenAcc/rewrites.f index 5daf9e9fc9fb78cfbec161b7dd949cf31df9b1fa..d486f99be5fa48267816a664756af984e3d7aeee 100644 --- a/Parser/test-data/OpenAcc/rewrites.f +++ b/Parser/test-data/OpenAcc/rewrites.f @@ -4,262 +4,16 @@ ! if =========================================================================== - !$acc parallel if(1) - x = 1 - !$acc end parallel - - !$acc parallel if(a) - x = 1 - !$acc end parallel - - !$acc parallel if(a + 1) - x = 1 - !$acc end parallel - - !$acc parallel if(a%b) - x = 1 - !$acc end parallel - - !$acc parallel if(a(1,2)) - x = 1 - !$acc end parallel - - ! default(none) ================================================================ - - !$acc parallel default(none) - x = 1 - !$acc end parallel - - ! device type ================================================================== - - !$acc parallel device_type(t1) - x = 1 - !$acc end parallel - - !$acc parallel device_type(t1,t2) - x = 1 - !$acc end parallel - - !$acc parallel device_type(*) - x = 1 - !$acc end parallel - - ! short versions are expanded - - ! !$acc parallel dtype(t1) - ! x = 1 - ! !$acc end parallel - - ! !$acc parallel dtype(t1,t2) - ! x = 1 - ! !$acc end parallel - - ! !$acc parallel dtype(*) - ! x = 1 - ! !$acc end parallel - - ! tile ========================================================================= - - !$acc loop tile(myTile) + !$acc loop collapse(1) vector do i = 1,n(5) x = 1 end do !$acc end loop - ! wait ========================================================================= - - !$acc parallel wait(x + 1,2,y) - x = 1 - !$acc end parallel - - ! collapse ===================================================================== - - !$acc loop collapse(4) - do i = 1,n(5) - x = 1 - end do - !$acc end loop - - !$acc loop collapse(0) - do i = 1,n(5) - x = 1 - end do - !$acc end loop - - !$acc loop collapse(#TEST#) - do i = 1,n(5) - x = 1 - end do - !$acc end loop - - ! expression clauses =========================================================== - - !$acc parallel async(1 + x) - x = 1 - !$acc end parallel - - !$acc parallel num_gangs(1 + x) - x = 1 - !$acc end parallel - - !$acc parallel num_workers(1 + x) - x = 1 - !$acc end parallel - - !$acc parallel vector_length(1 + x) - x = 1 - !$acc end parallel - ! reduction ==================================================================== - ! operators - - !$acc parallel reduction(+:x) - x = 1 - !$acc end parallel - - !$acc parallel reduction(*:x) - x = 1 - !$acc end parallel - - !$acc parallel reduction(max:x) - x = 1 - !$acc end parallel - - !$acc parallel reduction(min:x) - x = 1 - !$acc end parallel - - !$acc parallel reduction(iand:x) - x = 1 - !$acc end parallel - - !$acc parallel reduction(ior:x) - x = 1 - !$acc end parallel - - !$acc parallel reduction(ieor:x) - x = 1 - !$acc end parallel - - !$acc parallel reduction(.and.:x) - x = 1 - !$acc end parallel - - !$acc parallel reduction(.or.:x) - x = 1 - !$acc end parallel - - !$acc parallel reduction(.eqv.:x) - x = 1 - !$acc end parallel - - !$acc parallel reduction(.neqv.:x) - x = 1 - !$acc end parallel - - ! variabes - - !$acc parallel reduction(+:x,y,z) + !$acc parallel copyin() x = 1 !$acc end parallel - - ! variable list clauses ======================================================== - - !$acc enter data copy(x,y,z) - !$acc enter data copyin(x,y) - !$acc enter data copyout(x) - !$acc enter data create(x) - !$acc enter data delete(x) - !$acc enter data device(x) - !$acc enter data firstprivate(x) - !$acc enter data host(x) - !$acc enter data present(x) - !$acc enter data present_or_copy(x) - !$acc enter data present_or_copyin(x) - !$acc enter data present_or_copyout(x) - !$acc enter data present_or_create(x) - !$acc enter data private(x) - !$acc enter data self(x) - !$acc enter data use_device(x) - - ! short versions are expanded - ! !$acc enter data pcopy(x) - ! !$acc enter data pcopyin(x) - ! !$acc enter data pcopyout(x) - ! !$acc enter data pcreate(x) - - ! loop clauses ================================================================= - - !$acc loop gang - do i = 1,n(5) - x = 1 - end do - !$acc end loop - - !$acc loop worker - do i = 1,n(5) - x = 1 - end do - !$acc end loop - - !$acc loop vector - do i = 1,n(5) - x = 1 - end do - !$acc end loop - - !$acc loop independent - do i = 1,n(5) - x = 1 - end do - !$acc end loop - - !$acc loop gang(3) - do i = 1,n(5) - x = 1 - end do - !$acc end loop - - !$acc loop worker(3) - do i = 1,n(5) - x = 1 - end do - !$acc end loop - - !$acc loop vector(3) - do i = 1,n(5) - x = 1 - end do - !$acc end loop - - !$acc loop shortloop - do i = 1,n(5) - x = 1 - end do - !$acc end loop - - ! seq ========================================================================== - - !$acc routine(myRoutine) seq - - ! bind ========================================================================= - - !$acc routine(myRoutine) bind(aName) - - !$acc routine(myRoutine) bind('some string...! x = 1') - - ! nohost ======================================================================= - - !$acc routine nohost - - ! device_resident ============================================================== - - !$acc declare device_resident(x,y,z) - - ! link ========================================================================= - - !$acc declare link(x,y,z) - end diff --git a/Parser/test-data/OpenAcc/routine.f b/Parser/test-data/OpenAcc/routine.f index 24f5e8e8eb0de41966052579cb8a43521bb1a57a..799aaf37d641bef59b875521ed696ad8016a7960 100644 --- a/Parser/test-data/OpenAcc/routine.f +++ b/Parser/test-data/OpenAcc/routine.f @@ -1,8 +1,8 @@ -!$acc routine if(x) + !$acc routine if(x) -!$acc routine(bla) + !$acc routine(bla) -!$acc routine(bla) if(x) + !$acc routine(bla) if(x) end diff --git a/Parser/test-data/OpenAcc/slots.f b/Parser/test-data/OpenAcc/slots.f index f5238a7db9550b5812a6f90122deba2726c6f6f9..0a0de81084dad63d32cb64581b7bb0f36ea2dc45 100644 --- a/Parser/test-data/OpenAcc/slots.f +++ b/Parser/test-data/OpenAcc/slots.f @@ -1,7 +1,7 @@ -!$acc loop private(#PVT#) collapse(#NEST#) -do i = 0,10 - #inner# -end do -!$acc end loop + !$acc loop private(#PVT#) collapse(#NEST#) + do i = 0,10 + #inner# + end do + !$acc end loop end \ No newline at end of file diff --git a/Parser/test-data/OpenAcc/update.f b/Parser/test-data/OpenAcc/update.f index 8a3463df597e4a24a22d825983d4b1bd046dabc2..b46d43ccb0bb47735569e848ecf8f5b99acc0b3d 100644 --- a/Parser/test-data/OpenAcc/update.f +++ b/Parser/test-data/OpenAcc/update.f @@ -1,6 +1,6 @@ -!$acc update + !$acc update -!$acc update if(x) + !$acc update if(x) end diff --git a/Parser/test-data/OpenAcc/wait.f b/Parser/test-data/OpenAcc/wait.f index 147f3724120793c6412ef000449885524dbed305..ab5ebeed8b11f22802e9e13ce7bd60125e2613af 100644 --- a/Parser/test-data/OpenAcc/wait.f +++ b/Parser/test-data/OpenAcc/wait.f @@ -1,13 +1,13 @@ -!$acc wait + !$acc wait -! does not work because empty list is omitted -! !$acc wait () + ! does not work because empty list is omitted + ! !$acc wait () -!$acc wait(1,x,1 + 1) + !$acc wait(1,x,1 + 1) -!$acc wait(1,x,1 + 1) if(x) + !$acc wait(1,x,1 + 1) if(x) -!$acc wait if(x) + !$acc wait if(x) end diff --git a/Parser/test-data/rules/R626.f90 b/Parser/test-data/rules/R626.f90 index 4d59c3b3153a4f363e32a2e37e41a0bb662431a5..96fb4d3ab04111aed1fbcec2be017c5f75edd506 100644 --- a/Parser/test-data/rules/R626.f90 +++ b/Parser/test-data/rules/R626.f90 @@ -6,6 +6,8 @@ 10 ALLOCATE(a,b) allocate(integer::a,b) allocate(a,stat=i, errmsg=blah, source=k) +allocate(m(n)%foo,stat=i, errmsg=blah, source=k) +allocate(m(n)%foo, source= t0(n*99)) end diff --git a/Parser/test/org/tud/forty/test/OpenAccTest.java b/Parser/test/org/tud/forty/test/OpenAccTest.java index fb537756015ca9c9381c2a1cb16a20947538c75c..a61fbd4e1f7043353bae56fb0ec35e0448b69fca 100644 --- a/Parser/test/org/tud/forty/test/OpenAccTest.java +++ b/Parser/test/org/tud/forty/test/OpenAccTest.java @@ -21,6 +21,16 @@ public class OpenAccTest extends TestBase { @Test(dataProvider = "OpenACC", groups = {"prettyprinter"}) public void testOpenAccPrettyPrinter(File f) throws Exception { - testParse(f, true, false, false, true, Root.class); + testParse(f, true, false, false, false, Root.class); + } + + @Test(dataProvider = "OpenACC", groups = {"prettyprinter"}) + public void testOpenAccPrettyPrinterCompare(File f) throws Exception { + testParse(f, true, false, true, true, Root.class); + } + + @Test(dataProvider = "OpenACC", groups = {"prettyprinter"}) + public void testOpenAccPrettyPrinterCompareWithWhitespace(File f) throws Exception { + testParse(f, true, false, true, false, Root.class); } } diff --git a/Parser/test/org/tud/forty/test/TestBase.java b/Parser/test/org/tud/forty/test/TestBase.java index e5d96cf6f52519a7f82eff52f003deee368b5db2..6bbc0834022b4b09b3f33d9dddb060809aa9051e 100644 --- a/Parser/test/org/tud/forty/test/TestBase.java +++ b/Parser/test/org/tud/forty/test/TestBase.java @@ -143,9 +143,10 @@ public class TestBase { } if (!r.hasValue()) { if (r.parseError().index > 0) { - Assert.assertTrue(r.hasValue(), "ParseError in " + file.getName() + ":" + parser.location(r.parseError().index) + ":(" + r.parseError().index + ") " + r.parseError().msg + "."); + System.err.println(parser.format(r.parseError())); + Assert.assertTrue(r.hasValue(), "ParseError in " + file.getName()); } else { - Assert.assertTrue(r.hasValue(), "ParseError in " + file.getName() + ":" + ":(" + r.parseError().index + ") " + r.parseError().msg + "."); + Assert.assertTrue(r.hasValue(), "ParseError in " + file.getName() + "."); } }