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

Subversion Repositories openrisc

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

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do run }
2
! { dg-options "-Wcharacter-truncation" }
3
! Tests the fix for PR31266: references to CHARACTER
4
! components lead to the wrong length being assigned to substring
5
! expressions.
6
type data
7
   character(len=5) :: c
8
end type data
9
type(data), dimension(5), target :: y
10
character(len=2), dimension(5) :: p
11
character(len=3), dimension(5) :: q
12
 
13
y(:)%c = "abcdef" ! { dg-warning "in assignment \\(5/6\\)" }
14
p(1) = y(1)%c(3:) ! { dg-warning "in assignment \\(2/3\\)" }
15
if (p(1).ne."cd") call abort()
16
 
17
p(1) = y(1)%c  ! { dg-warning "in assignment \\(2/5\\)" }
18
if (p(1).ne."ab") call abort()
19
 
20
q = "xyz"
21
p = q ! { dg-warning "CHARACTER expression will be truncated in assignment \\(2/3\\)" }
22
if (any (p.ne.q(:)(1:2))) call abort()
23
end

powered by: WebSVN 2.1.0

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