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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [pointer_remapping_4.f03] - Blame information for rev 708

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 "-std=f2003 -fall-intrinsics -fcheck=bounds" }
3
 
4
! PR fortran/45016
5
! Check pointer bounds remapping at runtime.
6
 
7
! Contributed by Daniel Kraft, d@domob.eu.
8
 
9
PROGRAM main
10
  IMPLICIT NONE
11
  INTEGER, TARGET :: arr(2_2:5), basem(-2:-1, 3:4_1)
12
  INTEGER, POINTER :: vec(:), vec2(:), mat(:, :)
13
 
14
  arr = (/ 1, 2, 3, 4 /)
15
  basem = RESHAPE (arr, SHAPE (basem))
16
 
17
  vec(0:) => arr
18
  IF (LBOUND (vec, 1) /= 0 .OR. UBOUND (vec, 1) /= 3) CALL abort ()
19
  IF (ANY (vec /= arr)) CALL abort ()
20
  IF (vec(0) /= 1 .OR. vec(2) /= 3) CALL abort ()
21
 
22
  ! Test with bound different of index type, so conversion is necessary.
23
  vec2(-5_1:) => vec
24
  IF (LBOUND (vec2, 1) /= -5 .OR. UBOUND (vec2, 1) /= -2) CALL abort ()
25
  IF (ANY (vec2 /= arr)) CALL abort ()
26
  IF (vec2(-5) /= 1 .OR. vec2(-3) /= 3) CALL abort ()
27
 
28
  mat(1:, 2:) => basem
29
  IF (ANY (LBOUND (mat) /= (/ 1, 2 /) .OR. UBOUND (mat) /= (/ 2, 3 /))) &
30
    CALL abort ()
31
  IF (ANY (mat /= basem)) CALL abort ()
32
  IF (mat(1, 2) /= 1 .OR. mat(1, 3) /= 3 .OR. mat(2, 3) /= 4) CALL abort ()
33
END PROGRAM main

powered by: WebSVN 2.1.0

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