1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! Tests for UNIT=function()
4 integer, target
:: itarget
5 character(20), target
:: ctarget
6 logical, target
:: ltarget
8 module procedure
:: intf
, pintf
, pchf
, logf
, plogf
11 integer function intf(n
)
12 integer(1), intent(in
) :: n
16 integer(2), intent(in
) :: n
17 integer, pointer :: pintf
22 integer(4), intent(in
) :: n
23 character(:), pointer :: pchf
26 logical function logf(n
)
27 integer(8), intent(in
) :: n
31 integer(16), intent(in
) :: n
32 logical, pointer :: plf
36 write(intf(6_1),"('hi')")
37 write(pintf(6_2),"('hi')")
38 write(pchf(123_4),"('hi')")
39 write(gf(6_1),"('hi')")
40 write(gf(6_2),"('hi')")
41 write(gf(666_4),"('hi')")
42 !ERROR: I/O unit must be a character variable or a scalar integer expression
43 write(logf(666_8),"('hi')")
44 !ERROR: I/O unit must be a character variable or a scalar integer expression
45 write(plogf(666_16),"('hi')")
46 !ERROR: I/O unit must be a character variable or a scalar integer expression
47 write(gf(666_8),"('hi')")
48 !ERROR: I/O unit must be a character variable or a scalar integer expression
49 write(gf(666_16),"('hi')")
50 !ERROR: I/O unit must be a character variable or a scalar integer expression
51 write(null(),"('hi')")