Skip to content

Commit e35f45e

Browse files
committed
TEST: Add test and update refs
1 parent c986b38 commit e35f45e

File tree

4 files changed

+200
-2
lines changed

4 files changed

+200
-2
lines changed

tests/intent_01.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
@dataclass
2+
class Foo:
3+
p: i32
4+
5+
def f(x: i32, y: In[f64], z: InOut[list[u32]], w: Out[Foo[5]]):
6+
pass
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"basename": "asr-intent_01-66824bc",
3+
"cmd": "lpython --show-asr --no-color {infile} -o {outfile}",
4+
"infile": "tests/intent_01.py",
5+
"infile_hash": "0a8fa2940567fccee2cfccd4af40f353b74dbe542590460a195246a5",
6+
"outfile": null,
7+
"outfile_hash": null,
8+
"stdout": "asr-intent_01-66824bc.stdout",
9+
"stdout_hash": "6c217775c0f43212356588d01124266dfe417ce0fd72c63c8cec30ad",
10+
"stderr": null,
11+
"stderr_hash": null,
12+
"returncode": 0
13+
}
Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
(TranslationUnit
2+
(SymbolTable
3+
1
4+
{
5+
_global_symbols:
6+
(Module
7+
(SymbolTable
8+
5
9+
{
10+
Foo:
11+
(StructType
12+
(SymbolTable
13+
2
14+
{
15+
p:
16+
(Variable
17+
2
18+
p
19+
[]
20+
Local
21+
()
22+
()
23+
Default
24+
(Integer 4 [])
25+
Source
26+
Public
27+
Required
28+
.false.
29+
)
30+
})
31+
Foo
32+
[]
33+
[p]
34+
Source
35+
Public
36+
.false.
37+
.false.
38+
()
39+
()
40+
),
41+
f:
42+
(Function
43+
(SymbolTable
44+
3
45+
{
46+
w:
47+
(Variable
48+
3
49+
w
50+
[]
51+
Out
52+
()
53+
()
54+
Default
55+
(Struct
56+
5 Foo
57+
[((IntegerConstant 0 (Integer 4 []))
58+
(IntegerConstant 5 (Integer 4 [])))]
59+
)
60+
Source
61+
Public
62+
Required
63+
.false.
64+
),
65+
x:
66+
(Variable
67+
3
68+
x
69+
[]
70+
In
71+
()
72+
()
73+
Default
74+
(Integer 4 [])
75+
Source
76+
Public
77+
Required
78+
.false.
79+
),
80+
y:
81+
(Variable
82+
3
83+
y
84+
[]
85+
In
86+
()
87+
()
88+
Default
89+
(Real 8 [])
90+
Source
91+
Public
92+
Required
93+
.false.
94+
),
95+
z:
96+
(Variable
97+
3
98+
z
99+
[]
100+
InOut
101+
()
102+
()
103+
Default
104+
(List
105+
(UnsignedInteger
106+
4
107+
[]
108+
)
109+
)
110+
Source
111+
Public
112+
Required
113+
.false.
114+
)
115+
})
116+
f
117+
(FunctionType
118+
[(Integer 4 [])
119+
(Real 8 [])
120+
(List
121+
(UnsignedInteger
122+
4
123+
[]
124+
)
125+
)
126+
(Struct
127+
5 Foo
128+
[((IntegerConstant 0 (Integer 4 []))
129+
(IntegerConstant 5 (Integer 4 [])))]
130+
)]
131+
()
132+
Source
133+
Implementation
134+
()
135+
.false.
136+
.false.
137+
.false.
138+
.false.
139+
.false.
140+
[]
141+
[]
142+
.false.
143+
)
144+
[]
145+
[(Var 3 x)
146+
(Var 3 y)
147+
(Var 3 z)
148+
(Var 3 w)]
149+
[]
150+
()
151+
Public
152+
.false.
153+
.false.
154+
()
155+
)
156+
})
157+
_global_symbols
158+
[]
159+
.false.
160+
.false.
161+
),
162+
main_program:
163+
(Program
164+
(SymbolTable
165+
4
166+
{
167+
168+
})
169+
main_program
170+
[]
171+
[]
172+
)
173+
})
174+
[]
175+
)

tests/tests.toml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,6 @@ c = true
291291
filename = "test_end_sep_keywords.py"
292292
asr = true
293293

294-
# integration_tests
295-
296294
[[test]]
297295
filename = "lpython1.py"
298296
llvm = true
@@ -301,6 +299,12 @@ llvm = true
301299
filename = "print_str.py"
302300
wat = true
303301

302+
[[test]]
303+
filename = "intent_01.py"
304+
asr = true
305+
306+
# integration_tests
307+
304308
[[test]]
305309
filename = "../integration_tests/test_builtin.py"
306310
asr = true

0 commit comments

Comments
 (0)