+2012-11-28 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/52161
+ * trans-stmt.c (gfc_trans_sync): Fix bound checking.
+
2012-11-27 Tobias Burnus <burnus@net-b.de>
PR fortran/55476
gfc_trans_runtime_check (true, false, cond, &se.pre,
&code->expr1->where, "Invalid image number "
"%d in SYNC IMAGES",
- fold_convert (integer_type_node, se.expr));
+ fold_convert (integer_type_node, images));
}
/* Per F2008, 8.5.1, a SYNC MEMORY is implied by calling the
+2012-11-28 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/52161
+ * coarray/sync_3.f90: New.
+
2012-11-28 Uros Bizjak <ubizjak@gmail.com>
* gcc.target/i386/pr55458.c: Require ia32 target instead of ilp32.
--- /dev/null
+! { dg-do run }
+! { dg-options "-fcheck=all" }
+!
+! As sync_1, but with bounds checking enabled.
+! PR fortran/52161
+!
+! Coarray support
+! PR fortran/18918
+
+implicit none
+integer :: n
+character(len=30) :: str
+critical
+end critical
+myCr: critical
+end critical myCr
+
+!
+! Test SYNC ALL
+!
+sync all
+sync all ( )
+sync all (errmsg=str)
+
+n = 5
+sync all (stat=n)
+if (n /= 0) call abort()
+
+n = 5
+sync all (stat=n,errmsg=str)
+if (n /= 0) call abort()
+
+
+!
+! Test SYNC MEMORY
+!
+sync memory
+sync memory ( )
+sync memory (errmsg=str)
+
+n = 5
+sync memory (stat=n)
+if (n /= 0) call abort()
+
+n = 5
+sync memory (errmsg=str,stat=n)
+if (n /= 0) call abort()
+
+
+!
+! Test SYNC IMAGES
+!
+sync images (*)
+if (this_image() == 1) then
+ sync images (1)
+ sync images (1, errmsg=str)
+ sync images ([1])
+end if
+
+n = 5
+sync images (*, stat=n)
+if (n /= 0) call abort()
+
+n = 5
+sync images (*,errmsg=str,stat=n)
+if (n /= 0) call abort()
+
+end