Hi Paul,
This is an updated version of the earlier patch. The main addition is a second testcase that checks the errors emitted by the CFI API functions.
I notice that the header file ISO_Fortran_binding.h is found twice in the patch. Is there any particular reason why you do not want to use ! { dg-additional-options "-I $srcdir/../../libgfortran" } in the test cases, and have it only once in the source trees? However, I have no real strong opinion on this matter, if you want to keep it as submitted, it is also fine. Therefore: OK for trunk, and thanks a lot for the patch! Documentation we can add at a later date, I think. Regards Thomas