Skip to content

Commit beecbc4

Browse files
committed
Updated reference tests
1 parent 1977b60 commit beecbc4

6 files changed

+23
-3
lines changed

integration_tests/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,8 @@ RUN(NAME test_unary_minus LABELS cpython llvm)
169169
RUN(NAME test_unary_plus LABELS cpython llvm)
170170
RUN(NAME test_issue_518 LABELS cpython llvm)
171171
RUN(NAME structs_01 LABELS cpython llvm)
172+
RUN(NAME structs_02 LABELS llvm)
173+
RUN(NAME structs_03 LABELS llvm)
172174

173175
# Just CPython
174176
RUN(NAME test_builtin_bin LABELS cpython)

tests/reference/asr-structs_02-2ab459a.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
"basename": "asr-structs_02-2ab459a",
33
"cmd": "lpython --show-asr --no-color {infile} -o {outfile}",
44
"infile": "tests/../integration_tests/structs_02.py",
5-
"infile_hash": "6fef6d8ffa89f23edb2a6f01ed41cd310c152c81b840151f7457c722",
5+
"infile_hash": "0fd731b4917a779e353ab22d29a9dcaeecd767171e6d8ecf5191fde4",
66
"outfile": null,
77
"outfile_hash": null,
88
"stdout": "asr-structs_02-2ab459a.stdout",
9-
"stdout_hash": "bd8ca2fc3e77f4461f62726778bed4738540dbdc6167be95394f0069",
9+
"stdout_hash": "ae270bddb128266554c8fffeb51487c2d2a3c369c24e14db152ba93d",
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 {A: (DerivedType (SymbolTable 2 {x: (Variable 2 x Local () () Default (Integer 4 []) Source Public Required .false.), y: (Variable 2 y Local () () Default (Real 4 []) Source Public Required .false.)}) A [x y] Source Public ()), _lpython_main_program: (Subroutine (SymbolTable 6 {}) _lpython_main_program [] [(SubroutineCall 1 g () [] ())] Source Public Implementation () .false. .false.), f: (Subroutine (SymbolTable 3 {a: (Variable 3 a In () () Default (CPtr) BindC Public Required .true.), a1: (Variable 3 a1 Local () () Default (Derived 1 A []) Source Public Required .false.), a2: (Variable 3 a2 Local () () Default (Pointer (Derived 1 A [])) Source Public Required .false.), x: (Variable 3 x Local () () Default (Integer 4 []) Source Public Required .false.), y: (Variable 3 y Local () () Default (Real 4 []) Source Public Required .false.)}) f [(Var 3 a)] [(= (Var 3 a1) (DerivedTypeConstructor 1 A [(IntegerConstant 3 (Integer 4 [])) (Cast (RealConstant 3.25000000000000000e+00 (Real 8 [])) RealToReal (Real 4 []) (RealConstant 3.25000000000000000e+00 (Real 4 [])))] (Derived 1 A []) ()) ()) (= (Var 3 a2) (GetPointer (Var 3 a1) (Pointer (Derived 1 A [])) ()) ()) (= (Var 3 x) (DerivedRef (Var 3 a2) 2 x (Integer 4 []) ()) ()) (= (Var 3 y) (DerivedRef (Var 3 a2) 2 y (Real 4 []) ()) ()) (Assert (Compare (Var 3 x) Eq (IntegerConstant 3 (Integer 4 [])) (Logical 4 []) () ()) ()) (Assert (Compare (Cast (Var 3 y) RealToReal (Real 8 []) ()) Eq (RealConstant 3.25000000000000000e+00 (Real 8 [])) (Logical 4 []) () ()) ()) (CPtrToPointer (Var 3 a) (Var 3 a2) ()) (Print () [(Var 3 a) (Var 3 a2)])] BindC Public Implementation () .false. .false.), g: (Subroutine (SymbolTable 4 {b: (Variable 4 b Local () () Default (CPtr) Source Public Required .false.)}) g [] [(SubroutineCall 1 f () [((Var 4 b))] ())] Source Public Implementation () .false. .false.), main_program: (Program (SymbolTable 5 {}) main_program [] [(SubroutineCall 1 _lpython_main_program () [] ())])}) [])
1+
(TranslationUnit (SymbolTable 1 {A: (DerivedType (SymbolTable 2 {x: (Variable 2 x Local () () Default (Integer 4 []) Source Public Required .false.), y: (Variable 2 y Local () () Default (Real 4 []) Source Public Required .false.)}) A [x y] Source Public ()), _lpython_main_program: (Subroutine (SymbolTable 6 {}) _lpython_main_program [] [(SubroutineCall 1 g () [] ())] Source Public Implementation () .false. .false.), f: (Subroutine (SymbolTable 3 {a: (Variable 3 a In () () Default (CPtr) BindC Public Required .true.), a1: (Variable 3 a1 Local () () Default (Derived 1 A []) Source Public Required .false.), a2: (Variable 3 a2 Local () () Default (Pointer (Derived 1 A [])) Source Public Required .false.), x: (Variable 3 x Local () () Default (Integer 4 []) Source Public Required .false.), y: (Variable 3 y Local () () Default (Real 4 []) Source Public Required .false.)}) f [(Var 3 a)] [(= (Var 3 a1) (DerivedTypeConstructor 1 A [(IntegerConstant 3 (Integer 4 [])) (Cast (RealConstant 3.25000000000000000e+00 (Real 8 [])) RealToReal (Real 4 []) (RealConstant 3.25000000000000000e+00 (Real 4 [])))] (Derived 1 A []) ()) ()) (= (Var 3 a2) (GetPointer (Var 3 a1) (Pointer (Derived 1 A [])) ()) ()) (Print () [(Var 3 a2) (GetPointer (Var 3 a1) (Pointer (Derived 1 A [])) ())]) (= (Var 3 x) (DerivedRef (Var 3 a2) 2 x (Integer 4 []) ()) ()) (= (Var 3 y) (DerivedRef (Var 3 a2) 2 y (Real 4 []) ()) ()) (Assert (Compare (Var 3 x) Eq (IntegerConstant 3 (Integer 4 [])) (Logical 4 []) () ()) ()) (Assert (Compare (Cast (Var 3 y) RealToReal (Real 8 []) ()) Eq (RealConstant 3.25000000000000000e+00 (Real 8 [])) (Logical 4 []) () ()) ()) (CPtrToPointer (Var 3 a) (Var 3 a2) ()) (Print () [(Var 3 a) (Var 3 a2) (GetPointer (Var 3 a1) (Pointer (Derived 1 A [])) ())])] BindC Public Implementation () .false. .false.), g: (Subroutine (SymbolTable 4 {b: (Variable 4 b Local () () Default (CPtr) Source Public Required .false.)}) g [] [(SubroutineCall 1 f () [((Var 4 b))] ())] Source Public Implementation () .false. .false.), main_program: (Program (SymbolTable 5 {}) main_program [] [(SubroutineCall 1 _lpython_main_program () [] ())])}) [])
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"basename": "asr-structs_03-0cef911",
3+
"cmd": "lpython --show-asr --no-color {infile} -o {outfile}",
4+
"infile": "tests/../integration_tests/structs_03.py",
5+
"infile_hash": "64975e5bcbb620c3ed53f38dd8322dcaa6a38577b288abc909639645",
6+
"outfile": null,
7+
"outfile_hash": null,
8+
"stdout": "asr-structs_03-0cef911.stdout",
9+
"stdout_hash": "edf92b0144446b9950ae26d366deb99a293358840a200b975739d0c7",
10+
"stderr": null,
11+
"stderr_hash": null,
12+
"returncode": 0
13+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
(TranslationUnit (SymbolTable 1 {A: (DerivedType (SymbolTable 2 {x: (Variable 2 x Local () () Default (Integer 4 []) Source Public Required .false.), y: (Variable 2 y Local () () Default (Real 4 []) Source Public Required .false.)}) A [x y] Source Public ()), _lpython_main_program: (Subroutine (SymbolTable 6 {}) _lpython_main_program [] [(SubroutineCall 1 g () [] ())] Source Public Implementation () .false. .false.), f: (Subroutine (SymbolTable 3 {pa: (Variable 3 pa In () () Default (Pointer (Derived 1 A [])) Source Public Required .false.)}) f [(Var 3 pa)] [(Print () [(DerivedRef (Var 3 pa) 2 x (Integer 4 []) ())]) (Print () [(DerivedRef (Var 3 pa) 2 y (Real 4 []) ())])] Source Public Implementation () .false. .false.), g: (Subroutine (SymbolTable 4 {px: (Variable 4 px Local () () Default (Pointer (Derived 1 A [])) Source Public Required .false.), x: (Variable 4 x Local () () Default (Derived 1 A []) Source Public Required .false.)}) g [] [(= (Var 4 x) (DerivedTypeConstructor 1 A [(IntegerConstant 5 (Integer 4 [])) (Cast (RealConstant 5.50000000000000000e+00 (Real 8 [])) RealToReal (Real 4 []) (RealConstant 5.50000000000000000e+00 (Real 4 [])))] (Derived 1 A []) ()) ()) (= (Var 4 px) (GetPointer (Var 4 x) (Pointer (Derived 1 A [])) ()) ()) (= (DerivedRef (Var 4 px) 2 x (Integer 4 []) ()) (IntegerConstant 5 (Integer 4 [])) ()) (= (DerivedRef (Var 4 px) 2 y (Real 4 []) ()) (Cast (RealConstant 5.50000000000000000e+00 (Real 8 [])) RealToReal (Real 4 []) (RealConstant 5.50000000000000000e+00 (Real 4 []))) ()) (SubroutineCall 1 f () [((Var 4 px))] ())] Source Public Implementation () .false. .false.), main_program: (Program (SymbolTable 5 {}) main_program [] [(SubroutineCall 1 _lpython_main_program () [] ())])}) [])

tests/tests.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,10 @@ asr = true
209209
filename = "../integration_tests/structs_02.py"
210210
asr = true
211211

212+
[[test]]
213+
filename = "../integration_tests/structs_03.py"
214+
asr = true
215+
212216
[[test]]
213217
filename = "../integration_tests/bindc_01.py"
214218
asr = true

0 commit comments

Comments
 (0)