aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/run_tests.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/run_tests.cpp b/test/run_tests.cpp
index b72e23d23b..168fc3566f 100644
--- a/test/run_tests.cpp
+++ b/test/run_tests.cpp
@@ -973,6 +973,24 @@ pub fn main(argc: isize, argv: &&u8, env: &&u8) -> i32 {
return 0;
}
)SOURCE", "OK\n");
+
+ add_simple_case("memcpy and memset intrinsics", R"SOURCE(
+use "std.zig";
+pub fn main(argc: isize, argv: &&u8, env: &&u8) -> i32 {
+ var foo : [20]u8;
+ var bar : [20]u8;
+
+ @memset(foo.ptr, 'A', foo.len);
+ @memcpy(bar.ptr, foo.ptr, bar.len);
+
+ if (bar[11] != 'A') {
+ print_str("BAD\n");
+ }
+
+ print_str("OK\n");
+ return 0;
+}
+ )SOURCE", "OK\n");
}