Skip to content

Commit

Permalink
#2768 finish SIGN test with integer
Browse files Browse the repository at this point in the history
  • Loading branch information
arporter committed Nov 6, 2024
1 parent 02cd43e commit 111ace7
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -275,10 +275,14 @@ def test_sign_with_integer_arg(fortran_reader, fortran_writer, tmpdir):
end program test_prog'''
psyir = fortran_reader.psyir_from_source(code)
trans = Sign2CodeTrans()
sgn_call = psyir.walk(IntrinsicCall)
sgn_call = psyir.walk(IntrinsicCall)[0]
trans.apply(sgn_call)
result = fortran_writer(psyir)
assert "dadadada" in result
assert "integer(kind=idef) :: res_abs" in result
assert "integer(kind=idef) :: tmp_abs" in result
assert "if (tmp_abs > 0_idef) then" in result
assert "res_abs = tmp_abs * -1_idef" in result
assert Compile(tmpdir).string_compiles(result)


def test_sign_of_unknown_type(fortran_reader):
Expand Down

0 comments on commit 111ace7

Please sign in to comment.