brintos

brintos / llvm-project-archived public Read only

0
0
Text · 626 B · a717954 Raw
19 lines · plain
1! RUN: %flang_fc1 -fdebug-unparse %s 2>&1 | FileCheck %s2! Ensure that UBOUND() calculation from LBOUND()+SIZE() isn't applied to3! variables containing references to impure functions.4type t5  real, allocatable :: a(:)6end type7interface8  pure integer function pure(n)9    integer, intent(in) :: n10  end11end interface12type(t) :: x(10)13allocate(x(1)%a(2))14!CHECK: PRINT *, ubound(x(int(impure(1_4),kind=8))%a,dim=1_4)15print *, ubound(x(impure(1))%a, dim=1)16!CHECK: PRINT *, int(size(x(int(pure(1_4),kind=8))%a,dim=1,kind=8)+lbound(x(int(pure(1_4),kind=8))%a,dim=1,kind=8)-1_8,kind=4)17print *, ubound(x(pure(1))%a, dim=1)18end19