[flang] Accept polymorphic component element in storage_size
[llvm-project.git] / flang / test / Evaluate / fold-dim.f90
blob40163c3f5a5ee47db5805c3c477c6bfed6e6e741
1 ! RUN: %python %S/test_folding.py %s %flang_fc1
2 ! Tests folding of DIM()
3 module m
4 logical, parameter :: test_i1 = dim(0, 0) == 0
5 logical, parameter :: test_i2 = dim(1, 2) == 0
6 logical, parameter :: test_i3 = dim(2, 1) == 1
7 logical, parameter :: test_i4 = dim(2, -1) == 3
8 logical, parameter :: test_i5 = dim(-1, 2) == 0
9 logical, parameter :: test_a1 = dim(0., 0.) == 0.
10 logical, parameter :: test_a2 = dim(1., 2.) == 0.
11 logical, parameter :: test_a3 = dim(2., 1.) == 1.
12 logical, parameter :: test_a4 = dim(2., -1.) == 3.
13 logical, parameter :: test_a5 = dim(-1., 2.) == 0.
14 !WARN: warning: invalid argument on division
15 real, parameter :: nan = 0./0.
16 logical, parameter :: test_a6 = dim(nan, 1.) /= dim(nan, 1.)
17 end module