Skip to content

Commit e435d09

Browse files
committed
Update tests
1 parent 37b2ff6 commit e435d09

File tree

6 files changed

+13
-8
lines changed

6 files changed

+13
-8
lines changed

tests/reference/asr-loop2-e874469.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
"basename": "asr-loop2-e874469",
33
"cmd": "lpython --show-asr --no-color {infile} -o {outfile}",
44
"infile": "tests/loop2.py",
5-
"infile_hash": "8bc96fe7a628ac6571893b80a53dc45785f08e770c335319ad3e2cbc",
5+
"infile_hash": "0f1af9370fbae5de0ed9e612e933d7745598fc9c74b036496f4ae8ca",
66
"outfile": null,
77
"outfile_hash": null,
88
"stdout": "asr-loop2-e874469.stdout",
9-
"stdout_hash": "5c7a6323cbd8137a7b82feb7e6d4f0dfb976c28229af3e2244a2597c",
9+
"stdout_hash": "d1dc630006e0a7a21748d0a8bd26f3c99b277d5c208ed6d8077ac9e9",
1010
"stderr": null,
1111
"stderr_hash": null,
1212
"returncode": 0
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
(TranslationUnit (SymbolTable 1 {main_program: (Program (SymbolTable 3 {}) main_program [] []), test_for: (Subroutine (SymbolTable 2 {i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.)}) test_for [] [(DoLoop ((Var 2 i) (ConstantInteger 0 (Integer 4 [])) (BinOp (ConstantInteger 10 (Integer 4 [])) Sub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) (ConstantInteger 9 (Integer 4 [])) ()) (ConstantInteger 1 (Integer 4 []))) [(If (Compare (Var 2 i) Eq (ConstantInteger 0 (Integer 4 [])) (Logical 4 []) () ()) [(Cycle)] []) (If (Compare (Var 2 i) Gt (ConstantInteger 5 (Integer 4 [])) (Logical 4 []) () ()) [(Exit)] []) (If (Compare (Var 2 i) Eq (ConstantInteger 3 (Integer 4 [])) (Logical 4 []) () ()) [(Stop ())] [])]) (Stop ())] Source Public Implementation () .false. .false.)}) [])
1+
(TranslationUnit (SymbolTable 1 {exit: (ExternalSymbol 1 exit 3 exit sys [] exit Public), main_program: (Program (SymbolTable 6 {}) main_program [] []), sys: (Module (SymbolTable 3 {exit: (Subroutine (SymbolTable 4 {error_code: (Variable 4 error_code In () () Default (Integer 4 []) Source Public Required .false.)}) exit [(Var 4 error_code)] [(Stop (Var 4 error_code))] Source Public Implementation () .false. .false.)}) sys [] .false.), test_for: (Subroutine (SymbolTable 5 {i: (Variable 5 i Local () () Default (Integer 4 []) Source Public Required .false.)}) test_for [] [(DoLoop ((Var 5 i) (ConstantInteger 0 (Integer 4 [])) (BinOp (ConstantInteger 10 (Integer 4 [])) Sub (ConstantInteger 1 (Integer 4 [])) (Integer 4 []) (ConstantInteger 9 (Integer 4 [])) ()) (ConstantInteger 1 (Integer 4 []))) [(If (Compare (Var 5 i) Eq (ConstantInteger 0 (Integer 4 [])) (Logical 4 []) () ()) [(Cycle)] []) (If (Compare (Var 5 i) Gt (ConstantInteger 5 (Integer 4 [])) (Logical 4 []) () ()) [(Exit)] []) (If (Compare (Var 5 i) Eq (ConstantInteger 3 (Integer 4 [])) (Logical 4 []) () ()) [(Stop ())] [])]) (SubroutineCall 1 exit () [(ConstantInteger 0 (Integer 4 []))] ())] Source Public Implementation () .false. .false.)}) [])

tests/reference/ast-loop2-63bf329.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
"basename": "ast-loop2-63bf329",
33
"cmd": "lpython --show-ast --no-color {infile} -o {outfile}",
44
"infile": "tests/loop2.py",
5-
"infile_hash": "8bc96fe7a628ac6571893b80a53dc45785f08e770c335319ad3e2cbc",
5+
"infile_hash": "0f1af9370fbae5de0ed9e612e933d7745598fc9c74b036496f4ae8ca",
66
"outfile": null,
77
"outfile_hash": null,
88
"stdout": "ast-loop2-63bf329.stdout",
9-
"stdout_hash": "087c70fedf810add24d5c170994e52aee61ff6e6e91f0dabfe4f49ce",
9+
"stdout_hash": "a5cd7c1a9f0bdb94b4ae8a8ec509111aede5651ea109408828ce40c8",
1010
"stderr": null,
1111
"stderr_hash": null,
1212
"returncode": 0
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
(Module [(FunctionDef test_for ([] [] [] [] [] [] []) [(AnnAssign (Name i Store) (Name i32 Load) () 1) (For (Name i Store) (Call (Name range Load) [(ConstantInt 0 ()) (ConstantInt 10 ())] []) [(If (Compare (Name i Load) Eq [(ConstantInt 0 ())]) [(Continue)] []) (If (Compare (Name i Load) Gt [(ConstantInt 5 ())]) [(Break)] []) (If (Compare (Name i Load) Eq [(ConstantInt 3 ())]) [(Expr (Call (Name quit Load) [] []))] [])] [] ()) (Expr (Call (Name exit Load) [] []))] [] () ())] [])
1+
(Module [(ImportFrom sys [(exit ())] 0) (FunctionDef test_for ([] [] [] [] [] [] []) [(AnnAssign (Name i Store) (Name i32 Load) () 1) (For (Name i Store) (Call (Name range Load) [(ConstantInt 0 ()) (ConstantInt 10 ())] []) [(If (Compare (Name i Load) Eq [(ConstantInt 0 ())]) [(Continue)] []) (If (Compare (Name i Load) Gt [(ConstantInt 5 ())]) [(Break)] []) (If (Compare (Name i Load) Eq [(ConstantInt 3 ())]) [(Expr (Call (Name quit Load) [] []))] [])] [] ()) (Expr (Call (Name exit Load) [(ConstantInt 0 ())] []))] [] () ())] [])

tests/reference/cpp-loop2-0686fc4.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
"basename": "cpp-loop2-0686fc4",
33
"cmd": "lpython --no-color --show-cpp {infile}",
44
"infile": "tests/loop2.py",
5-
"infile_hash": "8bc96fe7a628ac6571893b80a53dc45785f08e770c335319ad3e2cbc",
5+
"infile_hash": "0f1af9370fbae5de0ed9e612e933d7745598fc9c74b036496f4ae8ca",
66
"outfile": null,
77
"outfile_hash": null,
88
"stdout": "cpp-loop2-0686fc4.stdout",
9-
"stdout_hash": "1b3ba76abf9c0f99b17c6b8293a0b73a0a6765c7716654832212aa9e",
9+
"stdout_hash": "eef4f1ff5b5b8880a2e873cd82808099e1f3612117a10667599f5d62",
1010
"stderr": null,
1111
"stderr_hash": null,
1212
"returncode": 0

tests/reference/cpp-loop2-0686fc4.stdout

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ void test_for()
3333
exit(0);
3434
}
3535

36+
void exit(int error_code)
37+
{
38+
exit(0);
39+
}
40+
3641
namespace {
3742

3843
void main2() {

0 commit comments

Comments
 (0)