Skip to content

Commit

Permalink
tests: update test references
Browse files Browse the repository at this point in the history
  • Loading branch information
parth121101 committed Jul 15, 2024
1 parent 2ded245 commit 8ff6f5f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/lfortran/semantics/ast_common_visitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -5350,9 +5350,9 @@ class CommonVisitor : public AST::BaseVisitor<Derived> {
}

void fill_optional_args(std::string intrinsic_name, Vec<ASR::expr_t*> &args, const Location &loc) {
ASR::ttype_t *int_type = ASRUtils::TYPE(
ASR::make_Integer_t(al, loc, 4));
if (intrinsic_name == "selected_real_kind") {
ASR::ttype_t *int_type = ASRUtils::TYPE(
ASR::make_Integer_t(al, loc, compiler_options.po.default_integer_kind));
ASR::expr_t* zero = ASRUtils::EXPR(
ASR::make_IntegerConstant_t(al, loc, 0,
int_type));
Expand All @@ -5371,8 +5371,6 @@ class CommonVisitor : public AST::BaseVisitor<Derived> {
} else if (intrinsic_name == "verify" || intrinsic_name == "index" || intrinsic_name == "scan") {
ASR::ttype_t *bool_type = ASRUtils::TYPE(
ASR::make_Logical_t(al, loc, 4));
ASR::ttype_t *int_type = ASRUtils::TYPE(
ASR::make_Integer_t(al, loc, 4));
ASR::expr_t* f = ASRUtils::EXPR(
ASR::make_LogicalConstant_t(al, loc, false, bool_type));
ASR::expr_t* four = ASRUtils::EXPR(
Expand All @@ -5397,8 +5395,6 @@ class CommonVisitor : public AST::BaseVisitor<Derived> {
int value;
int kind = ASRUtils::extract_kind_from_ttype_t(ASRUtils::expr_type(args[0]));
value = kind*8;
ASR::ttype_t *int_type = ASRUtils::TYPE(
ASR::make_Integer_t(al, loc, kind));
ASR::expr_t* val = ASRUtils::EXPR(
ASR::make_IntegerConstant_t(al, loc, value, int_type));
args.p[2] = val;
Expand Down
13 changes: 13 additions & 0 deletions tests/reference/asr-ishftc_size-1254b50.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"basename": "asr-ishftc_size-1254b50",
"cmd": "lfortran --show-asr --no-color {infile} -o {outfile}",
"infile": "tests/errors/ishftc_size.f90",
"infile_hash": "5765a2202b476e6d0522df41163ba488707e3b506dd4870c1b0eb7b4",
"outfile": null,
"outfile_hash": null,
"stdout": null,
"stdout_hash": null,
"stderr": "asr-ishftc_size-1254b50.stderr",
"stderr_hash": "9ce5eb1db3c8a9c92204d2bd13f6466f06e862c1b75c29dfe981a7d2",
"returncode": 2
}
5 changes: 5 additions & 0 deletions tests/reference/asr-ishftc_size-1254b50.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
semantic error: The SHIFT argument must be less than or equal to the of SIZE argument
--> tests/errors/ishftc_size.f90:2:14
|
2 | print *, ishftc(10, 6, 4)
| ^^^^^^^^^^^^^^^^

0 comments on commit 8ff6f5f

Please sign in to comment.