ifeq ($(subdir),dirent)
sysdep_routines += getdirentries getdirentries64
-tests += tst-getdents64
-
-# The tested readdir64 symbol was replaced in glibc 2.2.
-ifeq ($(have-GLIBC_2.1.3)$(build-shared),yesyes)
-tests += tst-readdir64-compat
-endif
+tests += \
+ tst-getdents64 \
+ tst-readdir64-compat \
+ # tests
endif # $(subdir) == dirent
ifeq ($(subdir),nis)
typedef struct __old_dirent64 *(*compat_readdir64_type) (DIR *);
+#if TEST_COMPAT (libc, GLIBC_2_1, GLIBC_2_2)
struct __old_dirent64 *compat_readdir64 (DIR *);
compat_symbol_reference (libc, compat_readdir64, readdir64, GLIBC_2_1);
+#endif
static int
do_test (void)
{
+#if TEST_COMPAT (libc, GLIBC_2_1, GLIBC_2_2)
/* Directory stream using the non-compat readdir64 symbol. The test
checks against this. */
DIR *dir_reference = opendir (".");
TEST_COMPARE (closedir (dir_test), 0);
TEST_COMPARE (closedir (dir_reference), 0);
+#endif
return 0;
}