2 ! Tests the fix for PR31211, in which the value of the result for
3 ! cp_get_default_logger was stored as a temporary, rather than the
4 ! pointer itself. This caused a segfault when the result was
7 ! Contributed by Joost VandeVondele <jv244@cam.ac.uk>
11 END TYPE cp_logger_type
13 if (cp_logger_log(cp_get_default_logger (0))) call abort ()
14 if (.not
. cp_logger_log(cp_get_default_logger (42))) call abort ()
18 logical function cp_logger_log(logger
)
19 TYPE(cp_logger_type
), POINTER ::logger
20 cp_logger_log
= associated (logger
) .and
. (logger
%a
.eq
. 42)
23 FUNCTION cp_get_default_logger(v
) RESULT(res
)
24 TYPE(cp_logger_type
), POINTER ::res
32 END FUNCTION cp_get_default_logger