OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [char_length_2.f90] - Blame information for rev 694

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do link }
2
! { dg-options "-Wsurprising" }
3
! Tests the fix for PR 31250
4
! CHARACTER lengths weren't reduced early enough for all checks of
5
! them to be meaningful.  Furthermore negative string lengths weren't
6
! dealt with correctly.
7
CHARACTER(len=0) :: c1   ! This is OK.
8
CHARACTER(len=-1) :: c2  ! { dg-warning "has negative length" }
9
PARAMETER(I=-100)
10
CHARACTER(len=I) :: c3   ! { dg-warning "has negative length" }
11
CHARACTER(len=min(I,500)) :: c4  ! { dg-warning "has negative length" }
12
CHARACTER(len=max(I,500)) :: d1  ! no warning
13
CHARACTER(len=5) :: d2   ! no warning
14
 
15
if (len(c1) .ne. 0) call link_error ()
16
if (len(c2) .ne. len(c1)) call link_error ()
17
if (len(c3) .ne. len(c2)) call link_error ()
18
if (len(c4) .ne. len(c3)) call link_error ()
19
 
20
if (len(d1) .ne. 500) call link_error ()
21
if (len(d2) .ne. 5) call link_error ()
22
END

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.