File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Expand file tree Collapse file tree 1 file changed +45
-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
+ // Test the basic operations of vect types
14
+ method test() throws {
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 VGET(v, 0) == 4;
25
+ VREMOVE(v, 0);
26
+ VADD(v, 5);
27
+ VINSERT(v, 0, 6);
28
+ VSETLAST(v, 7);
29
+ assert VGET(v, 1) == 7;
30
+ VGROW(v, 2);
31
+ assert VLEN(v) == 4;
32
+ VSHRINK(v, 2);
33
+ VTRUNCATE(v, 1);
34
+ assert VLEN(v) == 1;
35
+ local int vect v2;
36
+ VCOPY(v2, v1);
37
+ VCLEAR(v2);
38
+ assert VVEC(v1)[0] == 5;
39
+ assert VLEN(v2) == 0;
40
+ foreach i in (v) {
41
+ assert i == 5;
42
+ }
43
+ VFREE(v);
44
+ VFREE(v2);
45
+ }
You can’t perform that action at this time.
0 commit comments