mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-12-13 13:54:05 +08:00
PR fortran/PR35940
2008-05-01 Bud Davis <bdavis9659@sbcglobal.net> PR fortran/PR35940 * gfortran.dg/index.f90: New test. 2008-05-01 Bud Davis <bdavis9659@sbcglobal.net> PR35940/Fortran * simplify.c (gfc_simplify_index): Check for direction argument being a constant. From-SVN: r134879
This commit is contained in:
parent
c26cc9a6a6
commit
00113de86e
@ -1,3 +1,9 @@
|
||||
2008-05-01 Bud Davis <bdavis9659@sbcglobal.net>
|
||||
|
||||
PR35940/Fortran
|
||||
* simplify.c (gfc_simplify_index): Check for direction argument
|
||||
being a constant.
|
||||
|
||||
2008-05-01 Janus Weil <jaydub66@gmail.com>
|
||||
|
||||
* gfortran.h (struct gfc_symbol): Moving "interface" member to
|
||||
|
@ -1570,7 +1570,8 @@ gfc_simplify_index (gfc_expr *x, gfc_expr *y, gfc_expr *b, gfc_expr *kind)
|
||||
int back, len, lensub;
|
||||
int i, j, k, count, index = 0, start;
|
||||
|
||||
if (x->expr_type != EXPR_CONSTANT || y->expr_type != EXPR_CONSTANT)
|
||||
if (x->expr_type != EXPR_CONSTANT || y->expr_type != EXPR_CONSTANT
|
||||
|| ( b != NULL && b->expr_type != EXPR_CONSTANT))
|
||||
return NULL;
|
||||
|
||||
if (b != NULL && b->value.logical != 0)
|
||||
|
@ -1,3 +1,8 @@
|
||||
2008-05-01 Bud Davis <bdavis9659@sbcglobal.net>
|
||||
|
||||
PR fortran/PR35940
|
||||
* gfortran.dg/index.f90: New test.
|
||||
|
||||
2008-05-01 Simon Baldwin <simonb@google.com>
|
||||
|
||||
* testsuite/gcc.dg/Warray-bounds.c: Updated for frontend warnings,
|
||||
|
22
gcc/testsuite/gfortran.dg/index.f90
Normal file
22
gcc/testsuite/gfortran.dg/index.f90
Normal file
@ -0,0 +1,22 @@
|
||||
! { dg-do run }
|
||||
! pr35940
|
||||
program FA1031
|
||||
implicit none
|
||||
integer I
|
||||
INTEGER IDA1(10)
|
||||
LOGICAL GDA1(10)
|
||||
INTEGER RSLT(10)
|
||||
DATA RSLT /4,1,4,1,4,1,4,1,4,1/
|
||||
IDA1 = 0
|
||||
gda1 = (/ (i/2*2 .ne. I, i=1,10) /)
|
||||
|
||||
IDA1 = INDEX ( 'DEFDEF' , 'DEF', GDA1 ) !fails
|
||||
do I = 1, 10
|
||||
if (IDA1(i).NE.RSLT(i)) call abort
|
||||
end do
|
||||
IDA1 = INDEX ( (/ ('DEFDEF',i=1,10) /) , 'DEF', GDA1 ) !works
|
||||
do I = 1, 10
|
||||
if (IDA1(i).NE.RSLT(i)) call abort
|
||||
end do
|
||||
|
||||
END
|
Loading…
Reference in New Issue
Block a user