blob: b4cb67e63ccae089d6c27537bfc2938d07a6e4e4 [file]
# Compiler flags valid for both C and C++
TEST_CFLAGS=-Wno-format -Wno-unused-parameter -Wno-error=unused-function
AM_CFLAGS=@ADD_C_CXX_WARNING_FLAGS@ @ADD_C_ONLY_WARNING_FLAGS@ $(TEST_CFLAGS) -Wno-missing-prototypes
AM_CXXFLAGS=@ADD_C_CXX_WARNING_FLAGS@ $(TEST_CFLAGS)
# Link all test programs against libtest.a; for targets with their own
# target-specifc *_LDADD variable, make sure to add $(LDADD).
LDADD = $(builddir)/libtest.a
check_LIBRARIES = \
libtest.a
# libtest.a is a static library containing helper function for use by tests
# programs.
#
# When you write a new test, please include libtest.h and add a call to
# mingw_test_init() function upon entry to main().
libtest_a_SOURCES = \
libtest.c libtest.h
# Used by t_safe_flush
libprocdetach.dll: libprocdetach.o
$(LINK) -shared libprocdetach.o -o libprocdetach.dll
# Used by t_tls_dll_native
libtlsnat.dll: libtlsnat.o
$(LINK) -shared -o $@ $^
t_tls_dll_native.exe: libtlsnat.dll
# Used by t_tls_dll_native_process_detach
libtlsnatprocdet.dll: libtlsnatprocdet.o
$(LINK) -shared -o $@ $^
t_tls_dll_native_process_detach.exe: libtlsnatprocdet.dll
# Used by t_nontls_dll
libnontls.dll: libnontls.o
$(LINK) -shared -o $@ $^
t_nontls_dll.exe: libnontls.dll
# Used by t_noatexit_dll
libnoatexit.dll: libnoatexit.o
$(LINK) -shared -o $@ $^
t_noatexit_dll.exe: libnoatexit.dll
# Used by t_global_ctors
libglbctors.dll: libglbctors.o
$(LINK) -shared -static -o $@ $^ @TARGET_LIBGCC_FILE_NAME@
t_global_ctors.exe: libglbctors.dll
# Used by t_tls_dll
libtls01.dll: libtls01.o
$(LINK) -shared -o $@ $^
libtls02.dll: libtls02.o
$(LINK) -shared -o $@ $^
libtls03.dll: libtls03.o
$(LINK) -shared -o $@ $^
libtls04.dll: libtls04.o
$(LINK) -shared -o $@ $^
libtls05.dll: libtls05.o
$(LINK) -shared -o $@ $^
libtls06.dll: libtls06.o
$(LINK) -shared -o $@ $^
libtls07.dll: libtls07.o
$(LINK) -shared -o $@ $^
libtls08.dll: libtls08.o
$(LINK) -shared -o $@ $^
libtls09.dll: libtls09.o
$(LINK) -shared -o $@ $^
libtls10.dll: libtls10.o
$(LINK) -shared -o $@ $^
libtls11.dll: libtls11.o
$(LINK) -shared -o $@ $^
t_tls_dll.exe: libtls01.dll libtls02.dll libtls03.dll libtls04.dll libtls05.dll libtls06.dll libtls07.dll libtls08.dll libtls09.dll libtls10.dll libtls11.dll
# The following tests are compiled but not run with `make check`.
testcase_compile_only = \
t_intrin \
t_intrin_cpp \
t_scrnsave \
t_winmain
# FIXME:
#
# t_try1.cpp: this test is completely broken as it uses broken macros `__try1`
# and `__except1` from exept.h.
# Note that this list is usually sorted in alphabetical order.
# An exception is when variants of the same test are grouped together.
testcase_progs = \
t__fstat_all \
t__stat_all \
t__sys_errlist \
t_aligned_alloc \
t_ansi_io \
t_assert \
t_btowc \
t_char16_t \
t_ctype \
t_excpt_gcc_cpp \
t_excpt_int_divzero \
t_excpt_int_divzero_thrd \
t_excpt_int_overflow \
t_excpt_int_overflow_thrd \
t_exp_denormal \
t_expm1 \
t_fctptr \
t_findfirst \
t_float \
t_fmod \
t_format_Z \
t_format_Z0 \
t_format_Z1 \
t_fseeki64 \
t_fseeki64_ftelli64 \
t_fseeko64 \
t_fstat \
t_fstat_f64 \
t_fstat_t64 \
t_fstat_t64_f64 \
t_global_ctors \
t_imagebase \
t_intrinc \
t_isfine \
t_iswctype \
t_ivma \
t_lfs \
t_lseeki64 \
t_main \
t_main_assert \
t_main_cpp \
t_matherr \
t_mbrlen \
t_mbrtowc \
t_mbsrtowcs \
t_noatexit_dll \
t_nontls_dll \
t_nontls_exe \
t_tls_dll \
t_tls_dll_native \
t_tls_dll_native_process_detach \
t_tls_exe_dtor \
t_tls_exe_dyn \
t_tls_exe_native \
t_tls_exe_native_process_detach \
t_tls_exe_var \
t_nullptrexception \
t_pow \
t_powi \
t_printf \
t_printf_g_width \
t_readdir \
t_safe_flush \
t_setjmp \
t_sigfpe \
t_sigv \
t_snprintf \
t_snprintf0 \
t_snprintf1 \
t_snwprintf \
t_snwprintf0 \
t_snwprintf1 \
t_speed_powl \
t_stat \
t_stat_f64 \
t_stat_t64 \
t_stat_t64_f64 \
t_stat_slash \
t_staticconstmember \
t_stderr_buffering \
t_stdint \
t_stprintf_a \
t_stprintf_u \
t_stprintf0_a \
t_stprintf0_u \
t_stprintf1_a \
t_stprintf1_u \
t_swprintf \
t_swprintf0 \
t_swprintf1 \
t_time \
t_tls_ansi \
t_tls_c11 \
t_tmpfile \
t_towctrans \
t_trycatch \
t_tsearch \
t_utime \
t_vsscanf \
t_wcrtomb \
t_wcsrtombs \
t_wcstok_s \
t_wctob \
t_wctype \
t_winmain_assert \
t_wreaddir
# FIXME: the following tests are disabled on arm64ec; linking them statically
# with msvcrt.dll results in link error due to references to functions not
# available in msvcrt.dll, e.g. _strftime_l.
if !ARM64EC
testcase_progs += \
t_iostream \
t_tls_cpp \
t_wrongret
endif
# Most of the tests are C programs, but there are some C++ tests as well.
# For C++ targets, we have to explicitly specify source files so that
# Automake does not assume .c extension.
t_intrin_cpp_SOURCES = t_intrin_cpp.cpp
t_iostream_SOURCES = t_iostream.cpp
t_isfine_SOURCES = t_isfine.cpp
t_main_cpp_SOURCES = t_main_cpp.cpp
t_staticconstmember_SOURCES = t_staticconstmember.cpp
t_tls_cpp_SOURCES = t_tls_cpp.cpp
t_trycatch_SOURCES = t_trycatch.cpp
t_wrongret_SOURCES = t_wrongret.cpp
# On arm64ec, link all C++ tests statically; the toolchain (and the C++ DLL in
# PATH) may be regular native aarch64, but we build and run arm64ec binaries.
t_intrin_cpp_LDFLAGS = $(AM_LDFLAGS)
t_iostream_LDFLAGS = $(AM_LDFLAGS)
t_isfine_LDFLAGS = $(AM_LDFLAGS)
t_main_cpp_LDFLAGS = $(AM_LDFLAGS)
t_staticconstmember_LDFLAGS = $(AM_LDFLAGS)
t_tls_cpp_LDFLAGS = $(AM_LDFLAGS)
t_trycatch_LDFLAGS = $(AM_LDFLAGS)
t_wrongret_LDFLAGS = $(AM_LDFLAGS)
if ARM64EC
t_intrin_cpp_LDFLAGS += -static
t_iostream_LDFLAGS += -static
t_isfine_LDFLAGS += -static
t_main_cpp_LDFLAGS += -static
t_staticconstmember_LDFLAGS += -static
t_tls_cpp_LDFLAGS += -static
t_trycatch_LDFLAGS += -static
t_wrongret_LDFLAGS += -static
endif
# Test only for -static -lgcc
t_global_ctors_LDFLAGS = $(AM_LDFLAGS) -static
t_global_ctors_LDADD = @TARGET_LIBGCC_FILE_NAME@ $(LDADD)
# Compile t_intrinc in C99 mode
t_intrinc_CFLAGS = -std=c99 $(AM_CFLAGS)
# Link t_safe_flush against libprocdetach.dll
t_safe_flush_LDADD = libprocdetach.dll $(LDADD)
# Compile t_tls_ansi in C89 mode
t_tls_ansi_CFLAGS = -std=c89 $(AM_CFLAGS)
# Compile t_tls_c11 in C11 mode
t_tls_c11_CFLAGS = -std=c11 $(AM_CFLAGS)
# Link t_tls_dll_native against libtlsnat.dll
t_tls_dll_native_LDADD = libtlsnat.dll $(LDADD)
# Link t_tls_dll_native_process_detach against libtlsnatprocdet.dll
t_tls_dll_native_process_detach_LDADD = libtlsnatprocdet.dll $(LDADD)
# t_winmain is a GUI App; use -mwindows to properly link it and set subsystem
t_winmain_LDFLAGS = $(AM_LDFLAGS) -mwindows
# t_scrnsave and t_scrnsavw are GUI screenserver applications
t_scrnsave_LDFLAGS = $(AM_LDFLAGS) -mwindows
t_scrnsave_LDADD = $(LDADD) -lscrnsave
t_scrnsavw_LDFLAGS = $(AM_LDFLAGS) -mwindows
t_scrnsavw_LDADD = $(LDADD) -lscrnsavw
if ENABLE_TESTS_UNICODE
# The following tests require compiler support for -municode option
testcase_progs += \
t__wstat_all \
t_municode \
t_tmain
testcase_compile_only += \
t_scrnsavw
t_municode_CFLAGS = -municode $(AM_CFLAGS)
t_scrnsavw_CFLAGS = -municode $(AM_CFLAGS)
t_tmain_CFLAGS = -municode -D_UNICODE $(AM_CFLAGS)
t__wstat_all_CFLAGS = -municode $(AM_CFLAGS)
endif
check_PROGRAMS = \
$(testcase_compile_only) \
$(testcase_progs)
# Do not specify TESTS = check_PROGRAMS, because some TESTS
# may not be check_PROGRAMS.
TESTS = \
$(testcase_progs)
XFAIL_TESTS = \
t_excpt_int_divzero \
t_excpt_int_divzero_thrd \
t_excpt_int_overflow \
t_excpt_int_overflow_thrd \
t_nullptrexception
# Include the complex math testcase fragment.
include complex/Makefile.am
EXTRA_DIST = \
t_snprintf_tmpl.h \
t_snwprintf_tmpl.h \
t_stprintf_tmpl.h \
t_swprintf_tmpl.h
CLEANFILES = \
libglbctors.dll \
libnontls.dll \
libprocdetach.dll \
libtls01.dll \
libtls02.dll \
libtls03.dll \
libtls04.dll \
libtls05.dll \
libtls06.dll \
libtls07.dll \
libtls08.dll \
libtls09.dll \
libtls10.dll \
libtls11.dll \
libtlsnat.dll \
libtlsnatprocdet.dll