Skip to content

Commit 092a46e

Browse files
Add tests and update the refs.
1 parent ccd3cf1 commit 092a46e

File tree

167 files changed

+402
-373
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

167 files changed

+402
-373
lines changed

integration_tests/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,4 +429,5 @@ RUN(NAME comp_01 LABELS cpython llvm wasm wasm_x64)
429429
RUN(NAME bit_operations_i32 LABELS cpython llvm wasm wasm_x64)
430430
RUN(NAME bit_operations_i64 LABELS cpython llvm wasm)
431431

432-
RUN(NAME test_argv_01 LABELS llvm) # TODO: Test using CPython
432+
RUN(NAME test_argv_01 LABELS llvm) # TODO: Test using CPython
433+
RUN(NAME global_syms_01 LABELS cpython)

integration_tests/global_syms_01.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from ltypes import i32
2+
3+
x: list[i32]
4+
x = [1, 2]
5+
i: i32
6+
i = x[0]
7+
8+
def test_global_symbols():
9+
assert i == 1
10+
assert x[1] == 2
11+
12+
test_global_symbols()

tests/reference/asr-array_01_decl-39cf894.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"outfile": null,
77
"outfile_hash": null,
88
"stdout": "asr-array_01_decl-39cf894.stdout",
9-
"stdout_hash": "4409e567b0abf42b56cf4c70a66bf2e24bbeb61bc52338b26cb4840c",
9+
"stdout_hash": "4377072f8ac3cfc1bd619f53d07542c11dd648fa100d0f3104e1a4c7",
1010
"stderr": null,
1111
"stderr_hash": null,
1212
"returncode": 0

tests/reference/asr-array_01_decl-39cf894.stdout

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

tests/reference/asr-array_02_decl-e8f6874.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"outfile": null,
77
"outfile_hash": null,
88
"stdout": "asr-array_02_decl-e8f6874.stdout",
9-
"stdout_hash": "b2be9582bdf29f9c7dd1d480998ef8c7b5dbefba08d4f430e2316a7d",
9+
"stdout_hash": "dd1434de42dcd718f283abd72d736f032846819a9a31585b32a528c0",
1010
"stderr": null,
1111
"stderr_hash": null,
1212
"returncode": 0

tests/reference/asr-array_02_decl-e8f6874.stdout

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

tests/reference/asr-bindc_01-6d521a9.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"outfile": null,
77
"outfile_hash": null,
88
"stdout": "asr-bindc_01-6d521a9.stdout",
9-
"stdout_hash": "e6bb541aa0989bec3d752c073093cda3b80bb156bd9b2979c56bf7f5",
9+
"stdout_hash": "5c4a171ee17ace3f7a4345e89b0c4de32abb0a74f4f97efdeb056563",
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 {_lpython_main_program: (Function (SymbolTable 3 {}) _lpython_main_program (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] [] .false.) [] [] [(CPtrToPointer (Var 1 queries) (Var 1 x) ()) (Print () [(Var 1 queries) (Var 1 x)] () ())] () Public .false. .false.), main_program: (Program (SymbolTable 2 {}) main_program [] [(SubroutineCall 1 _lpython_main_program () [] ())]), queries: (Variable 1 queries [] Local () () Default (CPtr) Source Public Required .false.), x: (Variable 1 x [] Local () () Default (Pointer (Integer 2 [])) Source Public Required .false.)}) [])
1+
(TranslationUnit (SymbolTable 1 {_global_symbols: (Module (SymbolTable 4 {_lpython_main_program: (Function (SymbolTable 3 {}) _lpython_main_program (FunctionType [] () Source Implementation () .false. .false. .false. .false. .false. [] [] .false.) [] [] [(CPtrToPointer (Var 4 queries) (Var 4 x) ()) (Print () [(Var 4 queries) (Var 4 x)] () ())] () Public .false. .false.), queries: (Variable 4 queries [] Local () () Default (CPtr) Source Public Required .false.), x: (Variable 4 x [] Local () () Default (Pointer (Integer 2 [])) Source Public Required .false.)}) _global_symbols [] .false. .false.), main_program: (Program (SymbolTable 2 {_lpython_main_program: (ExternalSymbol 2 _lpython_main_program 4 _lpython_main_program _global_symbols [] _lpython_main_program Public)}) main_program [_global_symbols] [(SubroutineCall 2 _lpython_main_program () [] ())])}) [])

tests/reference/asr-bindc_02-bc1a7ea.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"outfile": null,
77
"outfile_hash": null,
88
"stdout": "asr-bindc_02-bc1a7ea.stdout",
9-
"stdout_hash": "ba2fbb9012c13e01cc2b596c7f706c8078bd1b285a11c861350cc358",
9+
"stdout_hash": "2e6dbece0d145af97d42a7780c4dd0701c3456381a9761bfb95da91c",
1010
"stderr": null,
1111
"stderr_hash": null,
1212
"returncode": 0

tests/reference/asr-bindc_02-bc1a7ea.stdout

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)