diff --git a/integration_tests/CMakeLists.txt b/integration_tests/CMakeLists.txt index f2a6bbc995..d19918b843 100644 --- a/integration_tests/CMakeLists.txt +++ b/integration_tests/CMakeLists.txt @@ -556,6 +556,7 @@ RUN(NAME test_list_compare LABELS cpython llvm llvm_jit) RUN(NAME test_list_concat LABELS cpython llvm llvm_jit c NOFAST) RUN(NAME test_list_reserve LABELS cpython llvm llvm_jit) RUN(NAME test_const_list LABELS cpython llvm llvm_jit) +RUN(NAME test_const_access LABELS cpython llvm llvm_jit) RUN(NAME test_tuple_01 LABELS cpython llvm llvm_jit c) RUN(NAME test_tuple_02 LABELS cpython llvm llvm_jit c NOFAST) RUN(NAME test_tuple_03 LABELS cpython llvm llvm_jit c) diff --git a/integration_tests/test_const_access.py b/integration_tests/test_const_access.py new file mode 100644 index 0000000000..4368e3ed0c --- /dev/null +++ b/integration_tests/test_const_access.py @@ -0,0 +1,9 @@ +from lpython import i32, Const + +CONST_LIST: Const[list[i32]] = [1, 2, 3, 4, 5] +CONST_DICTIONARY: Const[dict[str, i32]] = {"a": 1, "b": 2, "c": 3} + +assert CONST_LIST[0] == 1 +assert CONST_LIST[-2] == 4 + +assert CONST_DICTIONARY["a"] == 1 \ No newline at end of file