Skip to content

Commit bc58416

Browse files
committed
TEST: Update reference tests
1 parent 544e527 commit bc58416

12 files changed

+53
-175
lines changed

tests/reference/asr-expr9-814e4bc.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
"basename": "asr-expr9-814e4bc",
33
"cmd": "lpython --show-asr --no-color {infile} -o {outfile}",
44
"infile": "tests/expr9.py",
5-
"infile_hash": "1f02a7486b298ae9e74a163875a76f8fa7cc25d7f50547133dbbdfab",
5+
"infile_hash": "4819e0f20d2ed25647ab94f74cb7b5b61e3d4f43e159e46ad79c1c4c",
66
"outfile": null,
77
"outfile_hash": null,
88
"stdout": "asr-expr9-814e4bc.stdout",
9-
"stdout_hash": "fd9a9323419a77d41f2b3b06c607be0aab4dc626a070dda593b2117c",
9+
"stdout_hash": "b1daccda9413a8fc6ad88b8898e011d5f556e862f9b853b3564d7189",
1010
"stderr": null,
1111
"stderr_hash": null,
1212
"returncode": 0

tests/reference/asr-expr9-814e4bc.stdout

Lines changed: 17 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
_global_symbols:
66
(Module
77
(SymbolTable
8-
9
8+
8
99
{
1010
_lpython_main_program:
1111
(Function
1212
(SymbolTable
13-
8
13+
7
1414
{
1515

1616
})
@@ -33,7 +33,7 @@
3333
[main0]
3434
[]
3535
[(SubroutineCall
36-
9 main0
36+
8 main0
3737
()
3838
[]
3939
()
@@ -47,11 +47,11 @@
4747
main0:
4848
(Function
4949
(SymbolTable
50-
6
50+
5
5151
{
5252
i:
5353
(Variable
54-
6
54+
5
5555
i
5656
[]
5757
Local
@@ -66,7 +66,7 @@
6666
),
6767
s:
6868
(Variable
69-
6
69+
5
7070
s
7171
[]
7272
Local
@@ -98,13 +98,12 @@
9898
)
9999
[test_return_1
100100
test_return_2
101-
test_return_3
102-
test_return_4]
101+
test_return_3]
103102
[]
104103
[(=
105-
(Var 6 i)
104+
(Var 5 i)
106105
(FunctionCall
107-
9 test_return_1
106+
8 test_return_1
108107
()
109108
[((IntegerConstant 4 (Integer 4 [])))]
110109
(Integer 4 [])
@@ -114,9 +113,9 @@
114113
()
115114
)
116115
(=
117-
(Var 6 s)
116+
(Var 5 s)
118117
(FunctionCall
119-
9 test_return_2
118+
8 test_return_2
120119
()
121120
[((IntegerConstant 4 (Integer 4 [])))]
122121
(Character 1 -2 () [])
@@ -126,22 +125,16 @@
126125
()
127126
)
128127
(=
129-
(Var 6 i)
128+
(Var 5 i)
130129
(FunctionCall
131-
9 test_return_3
130+
8 test_return_3
132131
()
133132
[((IntegerConstant 4 (Integer 4 [])))]
134133
(Integer 4 [])
135134
()
136135
()
137136
)
138137
()
139-
)
140-
(SubroutineCall
141-
9 test_return_4
142-
()
143-
[((IntegerConstant 4 (Integer 4 [])))]
144-
()
145138
)]
146139
()
147140
Public
@@ -379,11 +372,6 @@
379372
[]
380373
[(Var 4 a)]
381374
[(=
382-
(Var 4 a)
383-
(IntegerConstant 3 (Integer 4 []))
384-
()
385-
)
386-
(=
387375
(Var 4 _lpython_return_variable)
388376
(Var 4 a)
389377
()
@@ -394,57 +382,6 @@
394382
.false.
395383
.false.
396384
()
397-
),
398-
test_return_4:
399-
(Function
400-
(SymbolTable
401-
5
402-
{
403-
a:
404-
(Variable
405-
5
406-
a
407-
[]
408-
In
409-
()
410-
()
411-
Default
412-
(Integer 4 [])
413-
Source
414-
Public
415-
Required
416-
.false.
417-
)
418-
})
419-
test_return_4
420-
(FunctionType
421-
[(Integer 4 [])]
422-
()
423-
Source
424-
Implementation
425-
()
426-
.false.
427-
.false.
428-
.false.
429-
.false.
430-
.false.
431-
[]
432-
[]
433-
.false.
434-
)
435-
[]
436-
[(Var 5 a)]
437-
[(=
438-
(Var 5 a)
439-
(IntegerConstant 1 (Integer 4 []))
440-
()
441-
)
442-
(Return)]
443-
()
444-
Public
445-
.false.
446-
.false.
447-
()
448385
)
449386
})
450387
_global_symbols
@@ -455,13 +392,13 @@
455392
main_program:
456393
(Program
457394
(SymbolTable
458-
7
395+
6
459396
{
460397
_lpython_main_program:
461398
(ExternalSymbol
462-
7
399+
6
463400
_lpython_main_program
464-
9 _lpython_main_program
401+
8 _lpython_main_program
465402
_global_symbols
466403
[]
467404
_lpython_main_program
@@ -471,7 +408,7 @@
471408
main_program
472409
[_global_symbols]
473410
[(SubroutineCall
474-
7 _lpython_main_program
411+
6 _lpython_main_program
475412
()
476413
[]
477414
()

tests/reference/asr-generics_02-e2ea5c9.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
"basename": "asr-generics_02-e2ea5c9",
33
"cmd": "lpython --show-asr --no-color {infile} -o {outfile}",
44
"infile": "tests/../integration_tests/generics_02.py",
5-
"infile_hash": "1103ff0edcb14e988eaa30252064dd77c7012884226c63f35f7aab01",
5+
"infile_hash": "f34adf5280ade332f6f72c81cdc0d18b463176f23df500f7a08370e0",
66
"outfile": null,
77
"outfile_hash": null,
88
"stdout": "asr-generics_02-e2ea5c9.stdout",
9-
"stdout_hash": "e1448166e4027e61053bec1c27e7887537ea0be09fbee1149526ad70",
9+
"stdout_hash": "07c6fa8bd4b7c07692d940f3a74dae682991c938db791445065c3638",
1010
"stderr": null,
1111
"stderr_hash": null,
1212
"returncode": 0

tests/reference/asr-generics_02-e2ea5c9.stdout

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
3
5151
x
5252
[]
53-
In
53+
InOut
5454
()
5555
()
5656
Default
@@ -65,7 +65,7 @@
6565
3
6666
y
6767
[]
68-
In
68+
InOut
6969
()
7070
()
7171
Default
@@ -195,7 +195,7 @@
195195
2
196196
x
197197
[]
198-
In
198+
InOut
199199
()
200200
()
201201
Default
@@ -213,7 +213,7 @@
213213
2
214214
y
215215
[]
216-
In
216+
InOut
217217
()
218218
()
219219
Default
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"basename": "asr-test_assign9-51278b8",
3+
"cmd": "lpython --show-asr --no-color {infile} -o {outfile}",
4+
"infile": "tests/errors/test_assign9.py",
5+
"infile_hash": "3aa4fda6489ce46f10fd95cd257f5d29a59629fc340d6d8ea5e983d8",
6+
"outfile": null,
7+
"outfile_hash": null,
8+
"stdout": null,
9+
"stdout_hash": null,
10+
"stderr": "asr-test_assign9-51278b8.stderr",
11+
"stderr_hash": "d6b69b941971863accaf997113f14a990e656c1665324bc3f2f66e8b",
12+
"returncode": 2
13+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
semantic error: Assignment to function parameter `x` is not allowed
2+
--> tests/errors/test_assign9.py:2:5
3+
|
4+
2 | x = 2
5+
| ^

tests/reference/ast-expr9-d184496.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
"basename": "ast-expr9-d184496",
33
"cmd": "lpython --show-ast --no-color {infile} -o {outfile}",
44
"infile": "tests/expr9.py",
5-
"infile_hash": "1f02a7486b298ae9e74a163875a76f8fa7cc25d7f50547133dbbdfab",
5+
"infile_hash": "4819e0f20d2ed25647ab94f74cb7b5b61e3d4f43e159e46ad79c1c4c",
66
"outfile": null,
77
"outfile_hash": null,
88
"stdout": "ast-expr9-d184496.stdout",
9-
"stdout_hash": "53f5e472ca197da7600955039541adb81d458cf53ea6e9c27b742adb",
9+
"stdout_hash": "75772c0465dba8aaa9f5cebf3c35558b77827a9b29570828744d84d9",
1010
"stderr": null,
1111
"stderr_hash": null,
1212
"returncode": 0

tests/reference/ast-expr9-d184496.stdout

Lines changed: 1 addition & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -113,18 +113,7 @@
113113
[]
114114
[]
115115
[])
116-
[(Assign
117-
[(Name
118-
a
119-
Store
120-
)]
121-
(ConstantInt
122-
3
123-
()
124-
)
125-
()
126-
)
127-
(Return
116+
[(Return
128117
(Name
129118
a
130119
Load
@@ -137,38 +126,6 @@
137126
)
138127
()
139128
)
140-
(FunctionDef
141-
test_return_4
142-
([]
143-
[(a
144-
(Name
145-
i32
146-
Load
147-
)
148-
())]
149-
[]
150-
[]
151-
[]
152-
[]
153-
[])
154-
[(Assign
155-
[(Name
156-
a
157-
Store
158-
)]
159-
(ConstantInt
160-
1
161-
()
162-
)
163-
()
164-
)
165-
(Return
166-
()
167-
)]
168-
[]
169-
()
170-
()
171-
)
172129
(FunctionDef
173130
main0
174131
([]
@@ -255,19 +212,6 @@
255212
[]
256213
)
257214
()
258-
)
259-
(Expr
260-
(Call
261-
(Name
262-
test_return_4
263-
Load
264-
)
265-
[(ConstantInt
266-
4
267-
()
268-
)]
269-
[]
270-
)
271215
)]
272216
[]
273217
()

tests/reference/cpp-expr9-48868e9.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
"basename": "cpp-expr9-48868e9",
33
"cmd": "lpython --no-color --show-cpp {infile}",
44
"infile": "tests/expr9.py",
5-
"infile_hash": "1f02a7486b298ae9e74a163875a76f8fa7cc25d7f50547133dbbdfab",
5+
"infile_hash": "4819e0f20d2ed25647ab94f74cb7b5b61e3d4f43e159e46ad79c1c4c",
66
"outfile": null,
77
"outfile_hash": null,
88
"stdout": "cpp-expr9-48868e9.stdout",
9-
"stdout_hash": "8b28ac34d62789df68c60f9a9e6925dbbe05f910916eca7cc0c47c42",
9+
"stdout_hash": "1e07d4af4823dc3f759e16cf567f814918c22127127013a16da3f473",
1010
"stderr": null,
1111
"stderr_hash": null,
1212
"returncode": 0

0 commit comments

Comments
 (0)