[flang] Accept polymorphic component element in storage_size
[llvm-project.git] / flang / test / Semantics / intrinsics01.f90
blob28808f8e766ba5394a7ecfa25760c7fe38716ba9
1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! Check for semantic errors for DREAL, DIMAG, DCONJG intrinsics
4 subroutine s()
5 real :: a
6 complex(4) :: c4 ! test scalar
7 complex(8) :: c8
8 complex(16) :: c16(2) ! test array
10 !ERROR: Actual argument for 'a=' has bad type 'REAL(4)'
11 print *, dreal(a)
13 print *, dreal(c4)
15 print *, dreal(c8)
17 print *, dreal(c16)
19 !ERROR: Actual argument for 'z=' has bad type 'REAL(4)'
20 print *, dimag(a)
22 !ERROR: Actual argument for 'z=' has bad type or kind 'COMPLEX(4)'
23 print *, dimag(c4)
25 print *, dimag(c8)
27 !ERROR: Actual argument for 'z=' has bad type or kind 'COMPLEX(16)'
28 print *, dimag(c16)
30 !ERROR: Actual argument for 'z=' has bad type 'REAL(4)'
31 print *, dconjg(a)
33 !ERROR: Actual argument for 'z=' has bad type or kind 'COMPLEX(4)'
34 print *, dconjg(c4)
36 print *, dconjg(c8)
38 !ERROR: Actual argument for 'z=' has bad type or kind 'COMPLEX(16)'
39 print *, dconjg(c16)
41 end subroutine