1 add_custom_target(libc_stdio_unittests)
12 libc.src.stdio.clearerr
69 libc.src.stdio.setvbuf
77 unlocked_fileop_test.cpp
81 libc.src.stdio.clearerr_unlocked
83 libc.src.stdio.feof_unlocked
84 libc.src.stdio.ferror_unlocked
85 libc.src.stdio.flockfile
87 libc.src.stdio.fread_unlocked
88 libc.src.stdio.funlockfile
89 libc.src.stdio.fwrite_unlocked
102 libc.src.stdio.clearerr
103 libc.src.stdio.fclose
105 libc.src.stdio.ferror
106 libc.src.stdio.fflush
107 libc.src.stdio.fopencookie
110 libc.src.stdio.fwrite
115 if(LIBC_CONF_PRINTF_DISABLE_FLOAT)
116 list(APPEND sprintf_test_copts "-DLIBC_COPT_PRINTF_DISABLE_FLOAT")
118 if(LIBC_CONF_PRINTF_DISABLE_INDEX_MODE)
119 list(APPEND sprintf_test_copts "-DLIBC_COPT_PRINTF_DISABLE_INDEX_MODE")
121 if(LIBC_CONF_PRINTF_DISABLE_WRITE_INT)
122 list(APPEND sprintf_test_copts "-DLIBC_COPT_PRINTF_DISABLE_WRITE_INT")
133 libc.src.stdio.sprintf
134 libc.src.__support.FPUtil.fp_bits
135 libc.src.__support.FPUtil.platform_defs
137 ${sprintf_test_copts}
147 libc.src.stdio.snprintf
150 if(LLVM_LIBC_FULL_BUILD)
151 # In fullbuild mode, fprintf's tests use the internal FILE for other functions.
152 list(APPEND fprintf_test_deps
153 libc.src.stdio.fclose
154 libc.src.stdio.ferror
158 # This is to be used for tests which write to libc's platform streams
159 # under full build but write to system-lib's streams otherwise.
160 set(hermetic_test_only HERMETIC_TEST_ONLY)
162 # Else in overlay mode they use the system's FILE.
163 set(use_system_file "-DLIBC_COPT_STDIO_USE_SYSTEM_FILE")
173 libc.src.stdio.fprintf
181 ${hermetic_test_only}
187 libc.src.stdio.printf
198 libc.src.stdio.vsprintf
208 libc.src.stdio.vsnprintf
218 libc.src.stdio.vfprintf
226 ${hermetic_test_only}
232 libc.src.stdio.vprintf
236 if(LLVM_LIBC_FULL_BUILD)
237 # In fullbuild mode, fscanf's tests use the internal FILE for other functions.
238 list(APPEND fscanf_test_deps
239 libc.src.stdio.fclose
240 libc.src.stdio.ferror
242 libc.src.stdio.fwrite
253 libc.src.stdio.fscanf
255 libc.src.__support.CPP.string_view
267 libc.src.stdio.sscanf
274 HERMETIC_TEST_ONLY # writes to libc's stdout
285 HERMETIC_TEST_ONLY # writes to libc's stdout and stderr
292 libc.src.stdio.stdout
293 libc.src.stdio.stderr
298 HERMETIC_TEST_ONLY # writes to libc's stdout and stderr
305 libc.src.stdio.putchar
306 libc.src.stdio.stdout
307 libc.src.stdio.stderr
318 libc.src.stdio.fwrite
319 libc.src.stdio.fclose
331 libc.src.stdio.fclose
332 libc.src.stdio.ferror
337 if(${LIBC_TARGET_OS} STREQUAL "linux")
348 libc.src.stdio.remove
349 libc.src.sys.stat.mkdirat
350 libc.src.unistd.access
351 libc.src.unistd.close
364 libc.src.stdio.fclose
366 libc.src.stdio.ferror
369 libc.src.stdio.fwrite
378 fgetc_unlocked_test.cpp
382 libc.src.stdio.fclose
383 libc.src.stdio.ferror
384 libc.src.stdio.ferror_unlocked
386 libc.src.stdio.feof_unlocked
387 libc.src.stdio.fgetc_unlocked
388 libc.src.stdio.flockfile
390 libc.src.stdio.funlockfile
391 libc.src.stdio.fwrite
392 libc.src.stdio.getc_unlocked
404 libc.src.stdio.fclose
406 libc.src.stdio.ferror
409 libc.src.stdio.fwrite
420 libc.src.stdio.fclose
421 libc.src.stdio.fflush
426 libc.src.stdio.fwrite
427 libc.src.stdio.setvbuf
430 # Create an output directory for any temporary test files.
431 file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/testdata)
433 if(LIBC_TARGET_ARCHITECTURE_IS_GPU)
437 add_subdirectory(printf_core)
438 add_subdirectory(scanf_core)
439 add_subdirectory(testdata)