File tree Expand file tree Collapse file tree 2 files changed +67
-0
lines changed
Expand file tree Collapse file tree 2 files changed +67
-0
lines changed Original file line number Diff line number Diff line change 1+ /*
2+ © 2025 Intel Corporation
3+ SPDX-License-Identifier: MPL-2.0
4+ */
5+ dml 1.4;
6+
7+ provisional simics_util_vect;
8+
9+ device test;
10+
11+ import "internal.dml";
12+
13+ method init() {
14+ local uint8 arr[3];
15+ /// ERROR ENLST
16+ foreach x in (arr) {
17+ }
18+ local int vect v;
19+ // this was allowed in DML 1.2
20+ /// ERROR ENLST
21+ foreach i in (v) {
22+ }
23+ }
Original file line number Diff line number Diff line change 1+ /*
2+ © 2025 Intel Corporation
3+ SPDX-License-Identifier: MPL-2.0
4+ */
5+ dml 1.4;
6+
7+ provisional simics_util_vect;
8+
9+ device test;
10+
11+ import "internal.dml";
12+
13+ // Test the basic operations of vect types
14+ method init() {
15+ local int vect v;
16+ VINIT(v);
17+ VADD(v, 3);
18+ assert VLEN(v) == 1;
19+ assert VELEMSIZE(v) == sizeoftype(int);
20+ VRESIZE(v, 2);
21+ VRESIZE_FREE(v, 1);
22+ VADD(v, 4);
23+ VDELETE_ORDER(v, 0);
24+ assert v[0] == 4;
25+ VREMOVE(v, 0);
26+ VADD(v, 5);
27+ VINSERT(v, 0, 6);
28+ VSETLAST(v, 7);
29+ assert v[1] == 7;
30+ v[1] = 8;
31+ assert v[1] == 8;
32+ VGROW(v, 2);
33+ assert VLEN(v) == 4;
34+ VSHRINK(v, 2);
35+ VTRUNCATE(v, 1);
36+ assert VLEN(v) == 1;
37+ assert cast(VVEC(v), int *)[0] == 6;
38+ local int vect v2;
39+ VCOPY(v2, v);
40+ VCLEAR(v2);
41+ assert VLEN(v2) == 0;
42+ VFREE(v);
43+ VFREE(v2);
44+ }
You can’t perform that action at this time.
0 commit comments