//===-- Unittests for vfprintf --------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // These tests are copies of the non-v variants of the printf functions. This is // because these functions are identical in every way except for how the varargs // are passed. #ifndef LIBC_COPT_STDIO_USE_SYSTEM_FILE #include "src/stdio/fclose.h" #include "src/stdio/ferror.h" #include "src/stdio/fopen.h" #include "src/stdio/fread.h" #endif // LIBC_COPT_STDIO_USE_SYSTEM_FILE #include "src/stdio/vfprintf.h" #include "test/UnitTest/Test.h" #include <stdio.h> namespace printf_test { #ifndef LIBC_COPT_STDIO_USE_SYSTEM_FILE using LIBC_NAMESPACE::fclose; using LIBC_NAMESPACE::ferror; using LIBC_NAMESPACE::fopen; using LIBC_NAMESPACE::fread; #else // defined(LIBC_COPT_STDIO_USE_SYSTEM_FILE) fclose; ferror; fopen; fread; #endif // LIBC_COPT_STDIO_USE_SYSTEM_FILE } // namespace printf_test int call_vfprintf(::FILE *__restrict stream, const char *__restrict format, ...) { … } TEST(LlvmLibcVFPrintfTest, WriteToFile) { … }