orca/tests/bulkmem/main.c

38 lines
789 B
C
Raw Normal View History

2023-09-07 12:51:48 +00:00
/*************************************************************************
*
2023-09-07 12:51:48 +00:00
* Orca
* Copyright 2023 Martin Fouilleul and the Orca project contributors
* See LICENSE.txt for licensing information
*
2023-09-07 12:51:48 +00:00
**************************************************************************/
#include <stddef.h>
#include <stdint.h>
void* memset(void* b, int c, size_t n)
{
2023-09-07 12:51:48 +00:00
return (__builtin_memset(b, c, n));
}
void* memcpy(void* dst, const void* src, size_t n)
{
2023-09-07 12:51:48 +00:00
return (__builtin_memcpy(dst, src, n));
}
int _start()
{
2023-09-07 12:51:48 +00:00
uint8_t buffer[1024];
uint8_t dst[1024];
memset(buffer, 0xff, 1024);
if(buffer[32] != 0xff)
{
__builtin_unreachable();
}
2023-09-07 12:51:48 +00:00
memcpy(dst, buffer, 1024);
if(dst[32] != 0xff)
{
__builtin_unreachable();
}
return (0);
}