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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do run }
2
! { dg-options "-fbounds-check" }
3
! { dg-shouldfail "Different CHARACTER lengths" }
4
! Tests the fix for PR34396, where the non-constant string lengths in the
5
! array constructor were being ignored and the bounds checking was not
6
! being done correctly.
7
!
8
! Contributed by Dominique d'Humieres 
9
!
10
program array_char
11
  implicit none
12
  integer :: i, j(5)
13
  character (len=5) :: x, y
14
  character (len=5) :: z(2)
15
  x = "ab"
16
  y = "cd"
17
  z = ""
18
  z = (/y(1: len (trim(y))), x(1: len (trim(x)))/)
19
  j = ichar ([(z(1)(i:i), i=1,5)])
20
  if (any (j .ne. (/99,100,32,32,32/))) call abort ()
21
  j = ichar ([(z(2)(i:i), i=1,5)])
22
  if (any (j .ne. (/97,98,32,32,32/))) call abort ()
23
  x = "a "
24
  z = (/y(1: len (trim(y))), x(1: len (trim(x)))/)
25
end program array_char
26
 
27
! { dg-output "At line 24 of file .*" }
28
! { dg-output "Different CHARACTER lengths .2/1. in array constructor" }

powered by: WebSVN 2.1.0

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