aboutsummaryrefslogtreecommitdiff
path: root/test/run_tests.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2016-01-09 02:16:54 -0700
committerAndrew Kelley <superjoe30@gmail.com>2016-01-09 02:16:54 -0700
commit6d9119fcd91cd01d658180d7fa5e4c8c203ba3db (patch)
tree95343f47aa29a3660e9ba1afee30ec27d1e192db /test/run_tests.cpp
parentbdca82ea66259de136ce9374e172f567ee93ef89 (diff)
downloadzig-6d9119fcd91cd01d658180d7fa5e4c8c203ba3db.tar.gz
zig-6d9119fcd91cd01d658180d7fa5e4c8c203ba3db.zip
add memcpy and memset intrinsics
Diffstat (limited to 'test/run_tests.cpp')
-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");
}