aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorThomas Koenig <tkoenig@gcc.gnu.org>2007-07-24 05:52:44 +0000
committerThomas Koenig <tkoenig@gcc.gnu.org>2007-07-24 05:52:44 +0000
commit18fe404fbc9a86d21bcb6d0f02cf2a1d4448d705 (patch)
tree977427f50ee91accd2a6424d4d19533a4274a057 /gcc/testsuite
parentbf3900bf1c5f579776d8aa769b38b19a7a05ccf7 (diff)
downloadgcc-18fe404fbc9a86d21bcb6d0f02cf2a1d4448d705.zip
gcc-18fe404fbc9a86d21bcb6d0f02cf2a1d4448d705.tar.gz
gcc-18fe404fbc9a86d21bcb6d0f02cf2a1d4448d705.tar.bz2
re PR fortran/30814 (non-conforming array sizes in PACK should raise an error)
2007-07-24 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/30814 * trans-decl.c (generate_function_code): Add argument for flag_bounds_check to the array for set_options. * invoke.texi: Mention that some checks require -fbounds-check to be set during compilation of the main program. 2007-07-24 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/30814 * libgfortran.h: Add bounds_check to compile_options_t. * runtime/compile_options.c (set_options): Add handling of compile_options.bounds_check. * intrinsics/pack_generic.c (pack_internal): Also determine the number of elements if compile_options.bounds_check is true. Raise runtime error if a different array shape is detected. 2007-07-24 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/30814 * gfortran.dg/pack_bounds_1.f90: New test case. From-SVN: r126866
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/pack_bounds_1.f9010
2 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index ce6a359..39a1404 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2007-07-24 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/30814
+ * gfortran.dg/pack_bounds_1.f90: New test case.
+
2007-07-23  Daniel Franke  <franke.daniel@gmail.com>
PR fortran/31639
diff --git a/gcc/testsuite/gfortran.dg/pack_bounds_1.f90 b/gcc/testsuite/gfortran.dg/pack_bounds_1.f90
new file mode 100644
index 0000000..94c8eb0
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pack_bounds_1.f90
@@ -0,0 +1,10 @@
+! { dg-do run }
+! { dg-options "-fbounds-check" }
+! { dg-shouldfail "Incorrect extent in return value of PACK intrinsic" }
+! PR 30814 - a bounds error with pack was not caught.
+program main
+ integer :: a(2,2), b(5)
+ a = reshape((/ 1, -1, 1, -1 /), shape(a))
+ b = pack(a, a /= 0)
+end program main
+! { dg-output "Fortran runtime error: Incorrect extent in return value of PACK intrinsic" }