[WebAssembly] Fix asan issue from https://reviews.llvm.org/D121349
[llvm-project.git] / flang / test / Semantics / misc-intrinsics.f90
blob0dc65fbd098cb93cf88ea95e46cd5ed76be208af
1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! Miscellaneous constraint and requirement checking on intrinsics
3 program test_size
4 real, dimension(5, 5) :: array
5 call test(array)
6 contains
7 subroutine test(arg)
8 real, dimension(5, *) :: arg
9 !ERROR: A dim= argument is required for 'size' when the array is assumed-size
10 print *, size(arg)
11 !ERROR: missing mandatory 'dim=' argument
12 print *, ubound(arg)
13 !ERROR: The 'source=' argument to the intrinsic function 'shape' may not be assumed-size
14 print *, shape(arg)
15 ! But these cases are fine:
16 print *, size(arg, dim=1)
17 print *, ubound(arg, dim=1)
18 print *, lbound(arg)
19 print *, size(array)
20 print *, ubound(array)
21 print *, lbound(array)
22 end subroutine
23 end