>> I understand, I wanted to not just report the issue but propose an option. >> It seems a bit heavy to design an effective target just for one test, >> though, no? > > It has the advantage of getting it right on all current and future targets.
Something like this? (not tested yet) diff --git a/libgomp/testsuite/lib/libgomp.exp b/libgomp/testsuite/lib/libgomp.exp index 2f9e538278f..85d467434e9 100644 --- a/libgomp/testsuite/lib/libgomp.exp +++ b/libgomp/testsuite/lib/libgomp.exp @@ -377,6 +377,24 @@ proc offload_target_to_openacc_device_type { offload_target } { } } +# Return 1 if certain nonstandard math functions are available +# on the target. +proc libgomp_check_effective_target_nonstandard_math_functions { } { + return [check_no_compiler_messages nonstandard_math_functions executable { +#include <math.h> +int main() { + float x = 42; + double y = 42; + x = gammaf (x); + x = __builtin_scalbf (x, 2.f); + x =__builtin_significandf (x); + y = gamma (y); + y = __builtin_scalb (y, 2.); + y =__builtin_significand (y); + return 0; +} } "-lm" ] +} + # Return 1 if compiling for the specified offload target # Takes -foffload=... into account by checking OFFLOAD_TARGET_NAMES= # in the -v compiler output.