The testsuite defines "fortran_large_real" for all systems that have a REAL kind > 8. However, there are cases where different things should really be tested for REAL(10) vs REAL(16) [my upcoming patch to fortran/PR37159 being one of them]. To not break existing testcases, how about defining two additional conditionals, say "fortran_has_real_10" and "fortan_has_real_16"? One (seemingly) simple way of figuring those guys out could be to compile the two canonical code snippets, dg-test for success and then run the actual Fortran tests. Without a clue of the testsuite-internals, unfortunately I have no idea if this is feasible.
If I am right real(10) is a leftover of the "coprocessor" era and is a peculiarity of the x86 processors (may be also 68k, I cannot remember). I think for all the other platforms with "fortran_large_real" use real(16). If this is correct a short term solution is to have two programs, one for "fortran_large_real" and *86* (and may be || *68k*) and one for "fortran_large_real" and !*86* (using the right syntax for the platform selection).
The GCC testsuite supports effective-target keywords which can be used anywhere that target lists are used; see the internals manual about Test Directives. Define an effective-target keyword xxx via check_effective_target_xxx in gcc/testsuite/lib/target-supports.exp.
> Define an effective-target keyword xxx via check_effective_target_xxx in > gcc/testsuite/lib/target-supports.exp. The only test I see is check_effective_target_fortran_large_real and it does not distinguishes between real(10) and real(16): # Return 1 if the target supports Fortran real kinds larger than real(8), # 0 otherwise. # # When the target name changes, replace the cached result. proc check_effective_target_fortran_large_real { } { return [check_no_compiler_messages fortran_large_real executable { ! Fortran integer,parameter :: k = selected_real_kind (precision (0.0_8) + 1) real(kind=k) :: x x = cos (x) end }] } Using precision(x) in similar tests could be used for check_effective_target_fortran_real_10 and check_effective_target_fortran_real_16: precision(x)==18 for real(10) and is larger than 30 for real(16) (31 on powerpc-apple-darwin9, 33 with ifort).