From: highegg on
program test_ETA ! Empty Target Association
real,dimension(10),target:: a
real,dimension(10):: b
real,dimension(:),pointer:: p
p => a(7:3)
print *,associated(p,a(7:3))
call ts(a(7:3),p)
print *,associated(p,a(7:3))
call ts2(a(7:3))
call ts2(b(7:3))
contains
subroutine ts(a,p)
real,dimension(:),intent(in),target:: a
real,dimension(:),pointer:: p
p => a
end subroutine
subroutine ts2(a)
real,dimension(:),intent(in),target:: a
real,dimension(:),pointer:: p
call ts(a,p)
print *,associated(p,a)
end subroutine
end program

What output in your opinion should the above program produce?
g95, gfortran 4.2 and Intel 9.1 for EM64T give all "F"s,
whereas PathScale 2.5 gives all "T"s. I couldn't find anything special
about empty targets in the standard; therefore, I think PathScale is
right. Is that true?

From: Michael Metcalf on
>
> What output in your opinion should the above program produce?

All Fs.

> g95, gfortran 4.2 and Intel 9.1 for EM64T give all "F"s,
> whereas PathScale 2.5 gives all "T"s. I couldn't find anything special
> about empty targets in the standard; therefore, I think PathScale is
> right. Is that true?
>

From MR&C, Section 8.2: "If the ... array size is zero, false is returned."

Regards,

Mike Metcalf


From: Greg Lindahl on
Your bug # is 11843.

-- greg


From: Greg Lindahl on
In article <45b3e541$1(a)news.meer.net>, Greg Lindahl <lindahl(a)pbm.com> wrote:

>Your bug # is 11843.

.... the fix has been checked in, and assuming it survives regression
testing, will be in our 3.0 release.

This is an interesting example of something required first in F95 that
wasn't in our test suites. Unfortunately there's no good test suite we
can buy that covers all the new F95 and new F2003 features. So we make
do with what we generate internally, plus public suites like
gfortran's test suites. Real applications that use F95 features are
fairly rare. Tonto is a good example, it found 5 bugs.

-- greg
(employed by, not speaking for, QLogic/PathScale.)


From: FX on
> So we make do with what we generate internally, plus public suites like
> gfortran's test suites.

Nice. Are you aware of any other project making available testsuites ?

> Real applications that use F95 features are fairly rare. Tonto is a
> good example, it found 5 bugs.

I suggest you try, if it's not done already, cp2k
(http://cp2k.berlios.de/). They make heavy use of F95 features.

--
FX
 | 
Pages: 1
Prev: Pointer to subroutine?
Next: IMSL