From 386e923f3b04192ed90dd83c00e5524c2215052f Mon Sep 17 00:00:00 2001
From: Johannes Mey <johannes.mey@tu-dresden.de>
Date: Tue, 14 Mar 2017 10:55:49 +0100
Subject: [PATCH] improved test data and tests for OpenACC

---
 Parser/test-data/OpenAcc/atomic.f             |  36 +-
 Parser/test-data/OpenAcc/cache.f              |   5 +-
 Parser/test-data/OpenAcc/clauses.f            | 386 +++++++++---------
 Parser/test-data/OpenAcc/data.f               |  34 +-
 Parser/test-data/OpenAcc/declare.f            |   5 +-
 Parser/test-data/OpenAcc/enter_data.f         |   4 +-
 Parser/test-data/OpenAcc/exit_data.f          |   4 +-
 Parser/test-data/OpenAcc/host_data.f          |  28 +-
 Parser/test-data/OpenAcc/kernels.f            |  28 +-
 Parser/test-data/OpenAcc/loop.f               | 111 +++--
 Parser/test-data/OpenAcc/parallel.f           |  28 +-
 Parser/test-data/OpenAcc/rewrites.f           | 250 +-----------
 Parser/test-data/OpenAcc/routine.f            |   6 +-
 Parser/test-data/OpenAcc/slots.f              |  10 +-
 Parser/test-data/OpenAcc/update.f             |   4 +-
 Parser/test-data/OpenAcc/wait.f               |  12 +-
 Parser/test-data/rules/R626.f90               |   2 +
 .../test/org/tud/forty/test/OpenAccTest.java  |  12 +-
 Parser/test/org/tud/forty/test/TestBase.java  |   5 +-
 19 files changed, 372 insertions(+), 598 deletions(-)

diff --git a/Parser/test-data/OpenAcc/atomic.f b/Parser/test-data/OpenAcc/atomic.f
index da00ba6..5020047 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 e07e60b..6788dc3 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 ef969e2..5daf9e9 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 ca29153..5e9ecc3 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 c30bc5b..b3e5718 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 1b9b300..05feed3 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 28d7b5d..8e5ddba 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 1fb07e0..79ff38f 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 a2480a5..dd27d00 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 050a222..ae31867 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 b7e3c2f..48713e9 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 5daf9e9..d486f99 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 24f5e8e..799aaf3 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 f5238a7..0a0de81 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 8a3463d..b46d43c 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 147f372..ab5ebee 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 4d59c3b..96fb4d3 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 fb53775..a61fbd4 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 e5d96cf..6bbc083 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() + ".");
             }
         }
 
-- 
GitLab