1 add_custom_target(libc_stdio_unittests)
12 libc.src.stdio.clearerr
70 libc.src.stdio.setvbuf
78 unlocked_fileop_test.cpp
82 libc.src.stdio.clearerr_unlocked
84 libc.src.stdio.feof_unlocked
85 libc.src.stdio.ferror_unlocked
86 libc.src.stdio.flockfile
88 libc.src.stdio.fread_unlocked
89 libc.src.stdio.funlockfile
90 libc.src.stdio.fwrite_unlocked
101 libc.hdr.types.size_t
103 libc.src.stdio.clearerr
104 libc.src.stdio.fclose
106 libc.src.stdio.ferror
107 libc.src.stdio.fflush
108 libc.src.stdio.fopencookie
111 libc.src.stdio.fwrite
116 if(LIBC_CONF_PRINTF_DISABLE_FLOAT)
117 list(APPEND sprintf_test_copts "-DLIBC_COPT_PRINTF_DISABLE_FLOAT")
119 if(LIBC_CONF_PRINTF_FLOAT_TO_STR_USE_DYADIC_FLOAT)
120 list(APPEND sprintf_test_copts "-DLIBC_COPT_FLOAT_TO_STR_REDUCED_PRECISION")
122 if(LIBC_CONF_PRINTF_DISABLE_INDEX_MODE)
123 list(APPEND sprintf_test_copts "-DLIBC_COPT_PRINTF_DISABLE_INDEX_MODE")
125 if(LIBC_CONF_PRINTF_DISABLE_WRITE_INT)
126 list(APPEND sprintf_test_copts "-DLIBC_COPT_PRINTF_DISABLE_WRITE_INT")
128 if(LIBC_CONF_PRINTF_DISABLE_FIXED_POINT)
129 list(APPEND sprintf_test_copts "-DLIBC_COPT_PRINTF_DISABLE_FIXED_POINT")
131 if(LIBC_CONF_PRINTF_DISABLE_STRERROR)
132 list(APPEND sprintf_test_copts "-DLIBC_COPT_PRINTF_DISABLE_STRERROR")
143 libc.src.stdio.sprintf
144 libc.src.__support.FPUtil.fp_bits
145 libc.include.inttypes
147 ${sprintf_test_copts}
157 libc.src.stdio.snprintf
160 if(LLVM_LIBC_FULL_BUILD)
161 # In fullbuild mode, fprintf's tests use the internal FILE for other functions.
162 list(APPEND fprintf_test_deps
163 libc.src.stdio.fclose
164 libc.src.stdio.ferror
168 # This is to be used for tests which write to libc's platform streams
169 # under full build but write to system-lib's streams otherwise.
170 set(hermetic_test_only HERMETIC_TEST_ONLY)
172 # Else in overlay mode they use the system's FILE.
173 set(use_system_file "-DLIBC_COPT_STDIO_USE_SYSTEM_FILE")
183 libc.src.stdio.fprintf
191 ${hermetic_test_only}
197 libc.src.stdio.printf
207 libc.src.stdio.asprintf
208 libc.src.string.memset
210 libc.src.stdio.sprintf
221 libc.src.stdio.vsprintf
231 libc.src.stdio.vsnprintf
241 libc.src.stdio.vfprintf
249 ${hermetic_test_only}
255 libc.src.stdio.vprintf
265 libc.src.stdio.vasprintf
266 libc.src.string.memset
268 libc.src.stdio.sprintf
271 if(LLVM_LIBC_FULL_BUILD)
272 # In fullbuild mode, fscanf's tests use the internal FILE for other functions.
273 list(APPEND fscanf_test_deps
274 libc.src.stdio.fclose
275 libc.src.stdio.ferror
277 libc.src.stdio.fwrite
281 # FIXME: These tests currently fail on AMDGPU due to an optimization bug in the
282 # `amdgpu-attributor` pass. Disable until that's fixed.
283 if(NOT LIBC_TARGET_ARCHITECTURE_IS_AMDGPU)
291 libc.src.stdio.fscanf
293 libc.src.__support.CPP.string_view
305 libc.src.stdio.vfscanf
307 libc.src.__support.CPP.string_view
313 if(LIBC_CONF_SCANF_DISABLE_FLOAT)
314 list(APPEND sscanf_test_copts "-DLIBC_COPT_SCANF_DISABLE_FLOAT")
316 if(LIBC_CONF_SCANF_DISABLE_INDEX_MODE)
317 list(APPEND sscanf_test_copts "-DLIBC_COPT_SCANF_DISABLE_INDEX_MODE")
327 libc.src.stdio.sscanf
341 libc.src.stdio.vsscanf
350 HERMETIC_TEST_ONLY # writes to libc's stdout
361 HERMETIC_TEST_ONLY # writes to libc's stdout and stderr
368 libc.src.stdio.stdout
369 libc.src.stdio.stderr
374 HERMETIC_TEST_ONLY # writes to libc's stdout and stderr
381 libc.src.stdio.putchar
382 libc.src.stdio.stdout
383 libc.src.stdio.stderr
394 libc.src.stdio.fwrite
395 libc.src.stdio.fclose
407 libc.src.stdio.fclose
408 libc.src.stdio.ferror
413 if(${LIBC_TARGET_OS} STREQUAL "linux")
424 libc.src.stdio.remove
425 libc.src.sys.stat.mkdirat
426 libc.src.unistd.access
427 libc.src.unistd.close
439 libc.src.stdio.rename
440 libc.src.unistd.access
441 libc.src.unistd.close
442 libc.test.UnitTest.ErrnoSetterMatcher
453 libc.src.stdio.fclose
454 libc.src.stdio.fdopen
457 libc.src.unistd.close
458 libc.test.UnitTest.ErrnoSetterMatcher
471 libc.src.stdio.fclose
473 libc.src.stdio.ferror
476 libc.src.stdio.fwrite
485 fgetc_unlocked_test.cpp
489 libc.src.stdio.fclose
490 libc.src.stdio.ferror
491 libc.src.stdio.ferror_unlocked
493 libc.src.stdio.feof_unlocked
494 libc.src.stdio.fgetc_unlocked
495 libc.src.stdio.flockfile
497 libc.src.stdio.funlockfile
498 libc.src.stdio.fwrite
499 libc.src.stdio.getc_unlocked
511 libc.src.stdio.fclose
513 libc.src.stdio.ferror
516 libc.src.stdio.fwrite
527 libc.src.stdio.fclose
528 libc.src.stdio.fflush
533 libc.src.stdio.fseeko
534 libc.src.stdio.ftello
535 libc.src.stdio.fwrite
536 libc.src.stdio.setvbuf
539 # Create an output directory for any temporary test files.
540 file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/testdata)
542 if(LIBC_TARGET_OS_IS_GPU)
546 add_subdirectory(printf_core)
547 add_subdirectory(scanf_core)
548 add_subdirectory(testdata)