[flang-commits] [flang] b1fdcd5 - [Flang] Allow compile *.f03, *.f08 file

Shao-Ce SUN via flang-commits flang-commits at lists.llvm.org
Sat Mar 11 09:11:53 PST 2023


Author: Shao-Ce SUN
Date: 2023-03-12T01:11:42+08:00
New Revision: b1fdcd5fbc09f9f3e1c8a8b954aa8f9067401b31

URL: https://github.com/llvm/llvm-project/commit/b1fdcd5fbc09f9f3e1c8a8b954aa8f9067401b31
DIFF: https://github.com/llvm/llvm-project/commit/b1fdcd5fbc09f9f3e1c8a8b954aa8f9067401b31.diff

LOG: [Flang] Allow compile *.f03, *.f08 file

Fix issue [#61260](https://github.com/llvm/llvm-project/issues/61260)

Reviewed By: awarzynski

Differential Revision: https://reviews.llvm.org/D145845

Added: 
    flang/test/Driver/supported-suffices/f03-suffix.f03
    flang/test/Driver/supported-suffices/f08-suffix.f08

Modified: 
    clang/lib/Driver/Types.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Driver/Types.cpp b/clang/lib/Driver/Types.cpp
index a890cc58ee421..7d6308d757bc7 100644
--- a/clang/lib/Driver/Types.cpp
+++ b/clang/lib/Driver/Types.cpp
@@ -331,6 +331,10 @@ types::ID types::lookupTypeForExtension(llvm::StringRef Ext) {
       .Case("cui", TY_PP_CUDA)
       .Case("cxx", TY_CXX)
       .Case("CXX", TY_CXX)
+      .Case("F03", TY_Fortran)
+      .Case("f03", TY_PP_Fortran)
+      .Case("F08", TY_Fortran)
+      .Case("f08", TY_PP_Fortran)
       .Case("F90", TY_Fortran)
       .Case("f90", TY_PP_Fortran)
       .Case("F95", TY_Fortran)

diff  --git a/flang/test/Driver/supported-suffices/f03-suffix.f03 b/flang/test/Driver/supported-suffices/f03-suffix.f03
new file mode 100644
index 0000000000000..6e03f9f43fc60
--- /dev/null
+++ b/flang/test/Driver/supported-suffices/f03-suffix.f03
@@ -0,0 +1,5 @@
+! RUN: %flang -### %s 2>&1 | FileCheck %s
+
+! CHECK: "{{.*}}flang-new" "-fc1" {{.*}} "-o" "{{.*}}.o"
+program f03
+end program f03

diff  --git a/flang/test/Driver/supported-suffices/f08-suffix.f08 b/flang/test/Driver/supported-suffices/f08-suffix.f08
new file mode 100644
index 0000000000000..d5bcf4ce1de1c
--- /dev/null
+++ b/flang/test/Driver/supported-suffices/f08-suffix.f08
@@ -0,0 +1,5 @@
+! RUN: %flang -### %s 2>&1 | FileCheck %s
+
+! CHECK: "{{.*}}flang-new" "-fc1" {{.*}} "-o" "{{.*}}.o"
+program f08
+end program f08


        


More information about the flang-commits mailing list