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

Subversion Repositories openrisc

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

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

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do compile }
2
! { dg-options "-fdump-tree-original" }
3
! Test the fix for PR45081 in which derived type array valued intrinsics failed
4
! to simplify, which caused an ICE in trans-array.c
5
!
6
! Contributed by Thorsten Ohl 
7
!
8
  module m
9
    implicit none
10
    integer :: i
11
    type t
12
      integer :: i
13
    end type t
14
    type(t), dimension(4), parameter :: t1  = [( t(i), i = 1, 4)]
15
    type(t), dimension(4), parameter :: t2  = [( t(i), i = 8, 11)]
16
    type(t), dimension(2,2), parameter :: a = reshape ( t1, [ 2, 2 ] )
17
    type(t), dimension(2,2), parameter :: b = transpose (a)
18
    type(t), dimension(4), parameter :: c = reshape ( b, [ 4 ] )
19
    type(t), dimension(2), parameter :: d = pack ( c, [.false.,.true.,.false.,.true.])
20
    type(t), dimension(4), parameter :: e = unpack (d, [.false.,.true.,.false.,.true.], t2)
21
    type(t), dimension(4,2), parameter :: f = spread (e, 2, 2)
22
    type(t), dimension(8), parameter :: g = reshape ( f, [ 8 ] )
23
    integer, parameter :: total = sum(g%i)
24
  end module m
25
 
26
    use m
27
    integer :: j
28
    j = total
29
  end
30
! { dg-final { scan-tree-dump-times "j = 50" 1 "original" } }
31
! { dg-final { cleanup-tree-dump "original" } }
32
! { dg-final { cleanup-modules "m" } }

powered by: WebSVN 2.1.0

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