Files
c3c/test/test_suite/stdlib/memcomp.c3t
2023-01-11 18:00:08 +01:00

16 lines
467 B
C

// #target: macos-x64
module test;
import std::io;
import libc;
fn void main()
{
int[] ab = { 3, 5, 6, 10, 0x0b2399 };
int[] cd = { 3, 5, 6, 10, 0x0b2399 };
char[] x = "hello world!";
char[] y = "hello world?";
io::printfn("is matching: %s", mem::equals(ab, cd));
io::printfn("is matching: %s", mem::equals(x, y));
io::printfn("is matching: %s", mem::equals(x.ptr, y.ptr, x.len));
io::printfn("is matching: %s", mem::equals(ab.ptr, cd.ptr, ab.len * 4, 4));
}