[libc][NFC] Switch startup tests to libc_errno.

This commit is contained in:
Siva Chandra Reddy 2023-03-13 22:11:32 +00:00
parent 30d894239a
commit 0b70f95c16

View File

@ -9,7 +9,7 @@
#include "include/errno.h"
#include "include/sys/mman.h"
#include "src/errno/llvmlibc_errno.h"
#include "src/errno/libc_errno.h"
#include "src/sys/mman/mmap.h"
#include "test/IntegrationTest/test.h"
@ -28,11 +28,11 @@ TEST_MAIN(int argc, char **argv, char **envp) {
// set in errno. Since errno is implemented using a thread
// local var, this helps us test setting of errno and
// reading it back.
ASSERT_TRUE(llvmlibc_errno == 0);
ASSERT_TRUE(libc_errno == 0);
void *addr = __llvm_libc::mmap(nullptr, 0, PROT_READ,
MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
ASSERT_TRUE(addr == MAP_FAILED);
ASSERT_TRUE(llvmlibc_errno == EINVAL);
ASSERT_TRUE(libc_errno == EINVAL);
return 0;
}