[flang-commits] [flang] [Flang][Parser] Handle compiler directives inside INTERFACE blocks (PR #198516)
Eugene Epshteyn via flang-commits
flang-commits at lists.llvm.org
Tue May 26 17:51:41 PDT 2026
================
@@ -0,0 +1,25 @@
+! RUN: %flang_fc1 -fsyntax-only %s 2>&1 | FileCheck %s
+
+! Test that unrecognized compiler directives inside INTERFACE blocks
+! produce a warning rather than a parse error.
+
+module m
+ interface
+ subroutine ccff
+ end subroutine ccff
+!CHECK: warning: Unrecognized compiler directive was ignored
+ !dir$ id "test"
+ end interface
+end module
+
+module m2
+ interface
+!CHECK: warning: Unrecognized compiler directive was ignored
+ !dir$ id "test"
+ subroutine foo(a)
----------------
eugeneepshteyn wrote:
Please also add a case, where the directive is between the two procedures:
```
interface
subroutine s1()
end subroutine
!dir$ ...
subroutine s2()
end subroutine
end interface
```
https://github.com/llvm/llvm-project/pull/198516
More information about the flang-commits
mailing list