77 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc1 -funsigned2 3implicit unsigned(u)4real a(10)5 6!ERROR: Must have INTEGER type, but is UNSIGNED(4)7real(kind=4u) x8 9!ERROR: Both operands must be UNSIGNED10print *, 0 + 1u11!ERROR: Both operands must be UNSIGNED12print *, 0u + 113!ERROR: Both operands must be UNSIGNED14print *, 0. + 1u15!ERROR: Both operands must be UNSIGNED16print *, 0u + 1.17 18print *, -0u ! ok19print *, 0u + 1u ! ok20print *, 0u - 1u ! ok21print *, 0u * 1u ! ok22print *, 0u / 1u ! ok23print *, 0u ** 1u ! ok24 25print *, uint((0.,0.)) ! ok26print *, uint(z'123') ! ok27!ERROR: Actual argument for 'a=' has bad type 'CHARACTER(KIND=1,LEN=1_8)'28print *, uint("a")29!ERROR: Actual argument for 'a=' has bad type 'LOGICAL(4)'30print *, uint(.true.)31!ERROR: Actual argument for 'l=' has bad type 'UNSIGNED(4)'32print *, logical(0u)33!ERROR: Actual argument for 'i=' has bad type 'UNSIGNED(4)'34print *, char(0u)35 36!ERROR: DO controls should be INTEGER37!ERROR: DO controls should be INTEGER38!ERROR: DO controls should be INTEGER39do u = 0u, 1u40end do41!ERROR: DO controls should be INTEGER42do u = 0, 143end do44!ERROR: DO controls should be INTEGER45!ERROR: DO controls should be INTEGER46do j = 0u, 1u47end do48 49select case (u) ! ok50case(0u) ! ok51!ERROR: CASE value has type 'INTEGER(4)' which is not compatible with the SELECT CASE expression's type 'UNSIGNED(4)'52case(1)53end select54 55select case (j)56!ERROR: CASE value has type 'UNSIGNED(4)' which is not compatible with the SELECT CASE expression's type 'INTEGER(4)'57case(0u)58end select59 60u = z'1' ! ok61!ERROR: No intrinsic or user-defined ASSIGNMENT(=) matches operand types UNSIGNED(4) and INTEGER(4)62u = 163!ERROR: No intrinsic or user-defined ASSIGNMENT(=) matches operand types INTEGER(4) and UNSIGNED(4)64j = 1u65 66!ERROR: I/O unit must be a character variable or a scalar integer expression, but is an expression of type UNSIGNED(4)67write(6u,*) 'hi'68 69!ERROR: ARITHMETIC IF expression must not be an UNSIGNED expression70if (1u) 1,1,1711 continue72 73!ERROR: Must have INTEGER type, but is UNSIGNED(4)74print *, a(u)75 76end77