Skip to content

Commit

Permalink
Added test for static size arrays.
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kurtenacker committed Nov 13, 2024
1 parent 2dd2b02 commit 5d9a888
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ add_test(NAME simple_mut COMMAND artic --print-ast --warnings-as-errors
add_test(NAME simple_static COMMAND artic --print-ast ${CMAKE_CURRENT_SOURCE_DIR}/simple/static.art)
add_test(NAME simple_arrays1 COMMAND artic --print-ast ${CMAKE_CURRENT_SOURCE_DIR}/simple/arrays1.art)
add_test(NAME simple_arrays2 COMMAND artic --print-ast ${CMAKE_CURRENT_SOURCE_DIR}/simple/arrays2.art)
add_test(NAME simple_arrays3 COMMAND artic --print-ast ${CMAKE_CURRENT_SOURCE_DIR}/simple/arrays3.art)
add_test(NAME simple_sort COMMAND artic --print-ast ${CMAKE_CURRENT_SOURCE_DIR}/simple/sort.art)
add_test(NAME simple_filters1 COMMAND artic --print-ast ${CMAKE_CURRENT_SOURCE_DIR}/simple/filters1.art)
add_test(NAME simple_filters2 COMMAND artic --print-ast ${CMAKE_CURRENT_SOURCE_DIR}/simple/filters2.art)
Expand Down
10 changes: 10 additions & 0 deletions test/simple/arrays3.art
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
static n = 3;

#[export]
fn test() {
let a = [3; n] : [i32 * n];
let b = [4; n];
let mut c : [i32 * n];
c(0) = a(0);
c(1) = b(1);
}

0 comments on commit 5d9a888

Please sign in to comment.