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

2023-03-11 Thread Shao-Ce SUN via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rGb1fdcd5fbc09: [Flang] Allow compile *.f03, *.f08 file 
(authored by sunshaoce).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D145845/new/

https://reviews.llvm.org/D145845

Files:
  clang/lib/Driver/Types.cpp
  flang/test/Driver/supported-suffices/f03-suffix.f03
  flang/test/Driver/supported-suffices/f08-suffix.f08


Index: flang/test/Driver/supported-suffices/f08-suffix.f08
===
--- /dev/null
+++ 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
Index: flang/test/Driver/supported-suffices/f03-suffix.f03
===
--- /dev/null
+++ 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
Index: clang/lib/Driver/Types.cpp
===
--- clang/lib/Driver/Types.cpp
+++ clang/lib/Driver/Types.cpp
@@ -331,6 +331,10 @@
   .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)


Index: flang/test/Driver/supported-suffices/f08-suffix.f08
===
--- /dev/null
+++ 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
Index: flang/test/Driver/supported-suffices/f03-suffix.f03
===
--- /dev/null
+++ 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
Index: clang/lib/Driver/Types.cpp
===
--- clang/lib/Driver/Types.cpp
+++ clang/lib/Driver/Types.cpp
@@ -331,6 +331,10 @@
   .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)
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2023-03-11 Thread Shao-Ce SUN via Phabricator via cfe-commits
sunshaoce updated this revision to Diff 504372.
sunshaoce added a comment.

Fix the issue of failing in the MSVC environment.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D145845/new/

https://reviews.llvm.org/D145845

Files:
  clang/lib/Driver/Types.cpp
  flang/test/Driver/supported-suffices/f03-suffix.f03
  flang/test/Driver/supported-suffices/f08-suffix.f08


Index: flang/test/Driver/supported-suffices/f08-suffix.f08
===
--- /dev/null
+++ 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
Index: flang/test/Driver/supported-suffices/f03-suffix.f03
===
--- /dev/null
+++ 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
Index: clang/lib/Driver/Types.cpp
===
--- clang/lib/Driver/Types.cpp
+++ clang/lib/Driver/Types.cpp
@@ -331,6 +331,10 @@
   .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)


Index: flang/test/Driver/supported-suffices/f08-suffix.f08
===
--- /dev/null
+++ 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
Index: flang/test/Driver/supported-suffices/f03-suffix.f03
===
--- /dev/null
+++ 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
Index: clang/lib/Driver/Types.cpp
===
--- clang/lib/Driver/Types.cpp
+++ clang/lib/Driver/Types.cpp
@@ -331,6 +331,10 @@
   .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)
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2023-03-11 Thread Shao-Ce SUN via Phabricator via cfe-commits
sunshaoce reopened this revision.
sunshaoce added a comment.
This revision is now accepted and ready to land.

Sorry! My previous tests were not comprehensive enough, which resulted in 
failures in the MSVC environment.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D145845/new/

https://reviews.llvm.org/D145845

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2023-03-11 Thread Shao-Ce SUN via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
sunshaoce marked an inline comment as done.
Closed by commit rG171794de533b: [Flang] Allow compile *.f03, *.f08 file 
(authored by sunshaoce).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D145845/new/

https://reviews.llvm.org/D145845

Files:
  clang/lib/Driver/Types.cpp
  flang/test/Driver/supported-suffices/f03-suffix.f03
  flang/test/Driver/supported-suffices/f08-suffix.f08


Index: flang/test/Driver/supported-suffices/f08-suffix.f08
===
--- /dev/null
+++ flang/test/Driver/supported-suffices/f08-suffix.f08
@@ -0,0 +1,5 @@
+! RUN: %flang -### %s 2>&1 | FileCheck %s
+
+! CHECK: "{{.*}}flang-new" "-fc1" {{.*}} "/tmp/{{.*}}.o"
+program f08
+end program f08
Index: flang/test/Driver/supported-suffices/f03-suffix.f03
===
--- /dev/null
+++ flang/test/Driver/supported-suffices/f03-suffix.f03
@@ -0,0 +1,5 @@
+! RUN: %flang -### %s 2>&1 | FileCheck %s
+
+! CHECK: "{{.*}}flang-new" "-fc1" {{.*}} "/tmp/{{.*}}.o"
+program f03
+end program f03
Index: clang/lib/Driver/Types.cpp
===
--- clang/lib/Driver/Types.cpp
+++ clang/lib/Driver/Types.cpp
@@ -331,6 +331,10 @@
   .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)


Index: flang/test/Driver/supported-suffices/f08-suffix.f08
===
--- /dev/null
+++ flang/test/Driver/supported-suffices/f08-suffix.f08
@@ -0,0 +1,5 @@
+! RUN: %flang -### %s 2>&1 | FileCheck %s
+
+! CHECK: "{{.*}}flang-new" "-fc1" {{.*}} "/tmp/{{.*}}.o"
+program f08
+end program f08
Index: flang/test/Driver/supported-suffices/f03-suffix.f03
===
--- /dev/null
+++ flang/test/Driver/supported-suffices/f03-suffix.f03
@@ -0,0 +1,5 @@
+! RUN: %flang -### %s 2>&1 | FileCheck %s
+
+! CHECK: "{{.*}}flang-new" "-fc1" {{.*}} "/tmp/{{.*}}.o"
+program f03
+end program f03
Index: clang/lib/Driver/Types.cpp
===
--- clang/lib/Driver/Types.cpp
+++ clang/lib/Driver/Types.cpp
@@ -331,6 +331,10 @@
   .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)
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2023-03-11 Thread Andrzej Warzynski via Phabricator via cfe-commits
awarzynski accepted this revision.
awarzynski added a comment.
This revision is now accepted and ready to land.

LGTM, thanks!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D145845/new/

https://reviews.llvm.org/D145845

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2023-03-11 Thread Shao-Ce SUN via Phabricator via cfe-commits
sunshaoce updated this revision to Diff 504363.
sunshaoce marked 2 inline comments as done.
sunshaoce added a comment.

Sorry, I just missed a comment.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D145845/new/

https://reviews.llvm.org/D145845

Files:
  clang/lib/Driver/Types.cpp
  flang/test/Driver/supported-suffices/f03-suffix.f03
  flang/test/Driver/supported-suffices/f08-suffix.f08


Index: flang/test/Driver/supported-suffices/f08-suffix.f08
===
--- /dev/null
+++ flang/test/Driver/supported-suffices/f08-suffix.f08
@@ -0,0 +1,5 @@
+! RUN: %flang -### %s 2>&1 | FileCheck %s
+
+! CHECK: "{{.*}}flang-new" "-fc1" {{.*}} "/tmp/{{.*}}.o"
+program f08
+end program f08
Index: flang/test/Driver/supported-suffices/f03-suffix.f03
===
--- /dev/null
+++ flang/test/Driver/supported-suffices/f03-suffix.f03
@@ -0,0 +1,5 @@
+! RUN: %flang -### %s 2>&1 | FileCheck %s
+
+! CHECK: "{{.*}}flang-new" "-fc1" {{.*}} "/tmp/{{.*}}.o"
+program f03
+end program f03
Index: clang/lib/Driver/Types.cpp
===
--- clang/lib/Driver/Types.cpp
+++ clang/lib/Driver/Types.cpp
@@ -331,6 +331,10 @@
   .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)


Index: flang/test/Driver/supported-suffices/f08-suffix.f08
===
--- /dev/null
+++ flang/test/Driver/supported-suffices/f08-suffix.f08
@@ -0,0 +1,5 @@
+! RUN: %flang -### %s 2>&1 | FileCheck %s
+
+! CHECK: "{{.*}}flang-new" "-fc1" {{.*}} "/tmp/{{.*}}.o"
+program f08
+end program f08
Index: flang/test/Driver/supported-suffices/f03-suffix.f03
===
--- /dev/null
+++ flang/test/Driver/supported-suffices/f03-suffix.f03
@@ -0,0 +1,5 @@
+! RUN: %flang -### %s 2>&1 | FileCheck %s
+
+! CHECK: "{{.*}}flang-new" "-fc1" {{.*}} "/tmp/{{.*}}.o"
+program f03
+end program f03
Index: clang/lib/Driver/Types.cpp
===
--- clang/lib/Driver/Types.cpp
+++ clang/lib/Driver/Types.cpp
@@ -331,6 +331,10 @@
   .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)
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2023-03-11 Thread Andrzej Warzynski via Phabricator via cfe-commits
awarzynski added inline comments.



Comment at: flang/test/Driver/supported-suffices/f08-suffix.f08:4
+! CHECK: "{{.*}}flang-new" "-fc1" {{.*}} "/tmp/{{.*}}.o"
+! CHECK: "{{.*}}ld" {{.*}} "/tmp/{{.*}}.o"
+program f08

This line will not appear without `-flang-experimental-exec` - you need to 
delete it. Same for the other test.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D145845/new/

https://reviews.llvm.org/D145845

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2023-03-11 Thread Shao-Ce SUN via Phabricator via cfe-commits
sunshaoce updated this revision to Diff 504362.
sunshaoce added a comment.

Address @awarzynski's comment


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D145845/new/

https://reviews.llvm.org/D145845

Files:
  clang/lib/Driver/Types.cpp
  flang/test/Driver/supported-suffices/f03-suffix.f03
  flang/test/Driver/supported-suffices/f08-suffix.f08


Index: flang/test/Driver/supported-suffices/f08-suffix.f08
===
--- /dev/null
+++ flang/test/Driver/supported-suffices/f08-suffix.f08
@@ -0,0 +1,6 @@
+! RUN: %flang -### %s 2>&1 | FileCheck %s
+
+! CHECK: "{{.*}}flang-new" "-fc1" {{.*}} "/tmp/{{.*}}.o"
+! CHECK: "{{.*}}ld" {{.*}} "/tmp/{{.*}}.o"
+program f08
+end program f08
Index: flang/test/Driver/supported-suffices/f03-suffix.f03
===
--- /dev/null
+++ flang/test/Driver/supported-suffices/f03-suffix.f03
@@ -0,0 +1,6 @@
+! RUN: %flang -### %s 2>&1 | FileCheck %s
+
+! CHECK: "{{.*}}flang-new" "-fc1" {{.*}} "/tmp/{{.*}}.o"
+! CHECK: "{{.*}}ld" {{.*}} "/tmp/{{.*}}.o"
+program f03
+end program f03
Index: clang/lib/Driver/Types.cpp
===
--- clang/lib/Driver/Types.cpp
+++ clang/lib/Driver/Types.cpp
@@ -331,6 +331,10 @@
   .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)


Index: flang/test/Driver/supported-suffices/f08-suffix.f08
===
--- /dev/null
+++ flang/test/Driver/supported-suffices/f08-suffix.f08
@@ -0,0 +1,6 @@
+! RUN: %flang -### %s 2>&1 | FileCheck %s
+
+! CHECK: "{{.*}}flang-new" "-fc1" {{.*}} "/tmp/{{.*}}.o"
+! CHECK: "{{.*}}ld" {{.*}} "/tmp/{{.*}}.o"
+program f08
+end program f08
Index: flang/test/Driver/supported-suffices/f03-suffix.f03
===
--- /dev/null
+++ flang/test/Driver/supported-suffices/f03-suffix.f03
@@ -0,0 +1,6 @@
+! RUN: %flang -### %s 2>&1 | FileCheck %s
+
+! CHECK: "{{.*}}flang-new" "-fc1" {{.*}} "/tmp/{{.*}}.o"
+! CHECK: "{{.*}}ld" {{.*}} "/tmp/{{.*}}.o"
+program f03
+end program f03
Index: clang/lib/Driver/Types.cpp
===
--- clang/lib/Driver/Types.cpp
+++ clang/lib/Driver/Types.cpp
@@ -331,6 +331,10 @@
   .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)
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2023-03-11 Thread Shao-Ce SUN via Phabricator via cfe-commits
sunshaoce updated this revision to Diff 504360.
sunshaoce added a comment.

Remove -flang-experimental-exec


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D145845/new/

https://reviews.llvm.org/D145845

Files:
  clang/lib/Driver/Types.cpp
  flang/test/Driver/f03-suffix.f03
  flang/test/Driver/f08-suffix.f08


Index: flang/test/Driver/f08-suffix.f08
===
--- /dev/null
+++ flang/test/Driver/f08-suffix.f08
@@ -0,0 +1,6 @@
+! RUN: %flang -### %s 2>&1 | FileCheck %s
+
+! CHECK: "{{.*}}flang-new" "-fc1" {{.*}} "/tmp/{{.*}}.o"
+! CHECK: "{{.*}}ld" {{.*}} "/tmp/{{.*}}.o"
+program f08
+end program f08
Index: flang/test/Driver/f03-suffix.f03
===
--- /dev/null
+++ flang/test/Driver/f03-suffix.f03
@@ -0,0 +1,6 @@
+! RUN: %flang -### %s 2>&1 | FileCheck %s
+
+! CHECK: "{{.*}}flang-new" "-fc1" {{.*}} "/tmp/{{.*}}.o"
+! CHECK: "{{.*}}ld" {{.*}} "/tmp/{{.*}}.o"
+program f03
+end program f03
Index: clang/lib/Driver/Types.cpp
===
--- clang/lib/Driver/Types.cpp
+++ clang/lib/Driver/Types.cpp
@@ -331,6 +331,10 @@
   .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)


Index: flang/test/Driver/f08-suffix.f08
===
--- /dev/null
+++ flang/test/Driver/f08-suffix.f08
@@ -0,0 +1,6 @@
+! RUN: %flang -### %s 2>&1 | FileCheck %s
+
+! CHECK: "{{.*}}flang-new" "-fc1" {{.*}} "/tmp/{{.*}}.o"
+! CHECK: "{{.*}}ld" {{.*}} "/tmp/{{.*}}.o"
+program f08
+end program f08
Index: flang/test/Driver/f03-suffix.f03
===
--- /dev/null
+++ flang/test/Driver/f03-suffix.f03
@@ -0,0 +1,6 @@
+! RUN: %flang -### %s 2>&1 | FileCheck %s
+
+! CHECK: "{{.*}}flang-new" "-fc1" {{.*}} "/tmp/{{.*}}.o"
+! CHECK: "{{.*}}ld" {{.*}} "/tmp/{{.*}}.o"
+program f03
+end program f03
Index: clang/lib/Driver/Types.cpp
===
--- clang/lib/Driver/Types.cpp
+++ clang/lib/Driver/Types.cpp
@@ -331,6 +331,10 @@
   .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)
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2023-03-11 Thread Andrzej Warzynski via Phabricator via cfe-commits
awarzynski added a comment.

I'd move these tests to flang/test/Driver/supported-suffices. That would help 
documenting what these tests actual check for. Also, one could be tempted to 
test for other suffices and then it would be nice to keep them in one place. Ta!




Comment at: flang/test/Driver/f03-suffix.f03:1
+! RUN: %flang -### -flang-experimental-exec %s 2>&1 | FileCheck %s
+

You can safely drop `-flang-experimental-exec` here.



Comment at: flang/test/Driver/f03-suffix.f03:4
+! CHECK: "{{.*}}flang-new" "-fc1" {{.*}} "/tmp/{{.*}}.o"
+! CHECK: "{{.*}}ld" {{.*}} "/tmp/{{.*}}.o"
+program f03

The linker invocation is unrelated to this change. Also, it will very likely 
look differently on other operating systems. Best to skip it.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D145845/new/

https://reviews.llvm.org/D145845

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2023-03-11 Thread Andrzej Warzynski via Phabricator via cfe-commits
awarzynski added a comment.

In D145845#4186608 , @clementval 
wrote:

> In D145845#4186607 , @awarzynski 
> wrote:
>
>> Thanks!
>>
>> In D145845#4186590 , @clementval 
>> wrote:
>>
>>> Thanks. Can you add tests in `flang/test/Driver`?
>>
>> Hm, this is a `clangDriver` change rather than anything Flang specific 🤔 . 
>> Btw, how does https://github.com/llvm/llvm-project/issues/61260 manifest to 
>> you? I'm trying to figure out how to best test it (I couldn't find any other 
>> tests for this specifically).
>
> Cannot we just have a a .f03 file and compile it and see if we have an 
> executable?

We don't really build executable for testing the Driver. Also, building an 
executable involves many steps:

1. The driver (`flang-new`) identifies the file as a valid Fortran file. 
Delegates to "Flang" for the next step.
2. "Flang" parses the input, runs semantic checks and lowers to LLVM IR. This 
is driven by the frontend driver, `flang-new -fc1`.
3. LLVM IR is compiled into machine code (via LLVM) (also driven by `flang-new 
-fc1`).
4. Machine code generated in 3 is then linked by the driver to generate an 
executable (this step is driven by `flang-new`).

  It would be good to understand what exactly this change unblocks and then 
test that specifically. To me it sounds like this change is only really needed 
for 1. and hence we should only be testing 1 and avoid doing extra work that's 
not needed.

I suspect that without this change, `.*.f03` files are recognized as object 
rather than Fortran files and hence step 1. is followed by step 4. rather than 
step 2. So, try `flang-new -### file.f03` **with** and **without** your change. 
You should see that **with** this change you do see the frontend driver 
invocation  (`flang-new -fc1 `) that would run steps 2 and 3.. IMO 
that's the only thing that requires verifying here.

Does this make sense?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D145845/new/

https://reviews.llvm.org/D145845

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2023-03-11 Thread Shao-Ce SUN via Phabricator via cfe-commits
sunshaoce added a comment.

Before

  $ /home/sunshaoce/dev/llvm-project/build/bin/flang-new 
/home/sunshaoce/dev/llvm-project/build/temp.f03 -flang-experimental-exec -o 
temp.out -###
  flang-new version 17.0.0 (https://github.com/llvm/llvm-project.git 
890e6c871d31dca9e461c01118cf25fb303b9cad)
  Target: x86_64-unknown-linux-gnu
  Thread model: posix
  InstalledDir: /home/sunshaoce/dev/llvm-project/build/bin
   "/usr/bin/ld" "-pie" "-z" "relro" "--hash-style=gnu" "--eh-frame-hdr" "-m" 
"elf_x86_64" "-dynamic-linker" "/lib64/ld-linux-x86-64.so.2" "-o" "temp.out" 
"/lib/x86_64-linux-gnu/Scrt1.o" "/lib/x86_64-linux-gnu/crti.o" 
"/usr/lib/gcc/x86_64-linux-gnu/9/crtbeginS.o" 
"-L/usr/lib/gcc/x86_64-linux-gnu/9" 
"-L/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib64" "-L/lib/x86_64-linux-gnu" 
"-L/lib/../lib64" "-L/usr/lib/x86_64-linux-gnu" "-L/usr/lib/../lib64" "-L/lib" 
"-L/usr/lib" "/home/sunshaoce/dev/llvm-project/build/temp.f03" 
"-L/home/sunshaoce/dev/llvm-project/build/lib" "-lFortran_main" 
"-lFortranRuntime" "-lFortranDecimal" "-lm" "-lgcc" "--as-needed" "-lgcc_s" 
"--no-as-needed" "-lc" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" 
"/usr/lib/gcc/x86_64-linux-gnu/9/crtendS.o" "/lib/x86_64-linux-gnu/crtn.o"

after

  $ /home/sunshaoce/dev/llvm-project/build/bin/flang-new 
/home/sunshaoce/dev/llvm-project/build/temp.f03 -flang-experimental-exec -o 
temp.out -###
  flang-new version 17.0.0 (https://github.com/llvm/llvm-project.git 
890e6c871d31dca9e461c01118cf25fb303b9cad)
  Target: x86_64-unknown-linux-gnu
  Thread model: posix
  InstalledDir: /home/sunshaoce/dev/llvm-project/build/bin
   "/home/sunshaoce/dev/llvm-project/build/bin/flang-new" "-fc1" "-triple" 
"x86_64-unknown-linux-gnu" "-emit-obj" "-fcolor-diagnostics" 
"-mrelocation-model" "pic" "-pic-level" "2" "-pic-is-pie" "-target-cpu" 
"x86-64" "-o" "/tmp/temp-72c5c0.o" "-x" "f95-cpp-input" 
"/home/sunshaoce/dev/llvm-project/build/temp.f03"
   "/usr/bin/ld" "-pie" "-z" "relro" "--hash-style=gnu" "--eh-frame-hdr" "-m" 
"elf_x86_64" "-dynamic-linker" "/lib64/ld-linux-x86-64.so.2" "-o" "temp.out" 
"/lib/x86_64-linux-gnu/Scrt1.o" "/lib/x86_64-linux-gnu/crti.o" 
"/usr/lib/gcc/x86_64-linux-gnu/9/crtbeginS.o" 
"-L/usr/lib/gcc/x86_64-linux-gnu/9" 
"-L/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib64" "-L/lib/x86_64-linux-gnu" 
"-L/lib/../lib64" "-L/usr/lib/x86_64-linux-gnu" "-L/usr/lib/../lib64" "-L/lib" 
"-L/usr/lib" "/tmp/temp-72c5c0.o" 
"-L/home/sunshaoce/dev/llvm-project/build/lib" "-lFortran_main" 
"-lFortranRuntime" "-lFortranDecimal" "-lm" "-lgcc" "--as-needed" "-lgcc_s" 
"--no-as-needed" "-lc" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" 
"/usr/lib/gcc/x86_64-linux-gnu/9/crtendS.o" "/lib/x86_64-linux-gnu/crtn.o"

So, I tested it by checking whether `flang` was called.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D145845/new/

https://reviews.llvm.org/D145845

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2023-03-11 Thread Shao-Ce SUN via Phabricator via cfe-commits
sunshaoce updated this revision to Diff 504359.
sunshaoce added a comment.

Add tests


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D145845/new/

https://reviews.llvm.org/D145845

Files:
  clang/lib/Driver/Types.cpp
  flang/test/Driver/f03-suffix.f03
  flang/test/Driver/f08-suffix.f08


Index: flang/test/Driver/f08-suffix.f08
===
--- /dev/null
+++ flang/test/Driver/f08-suffix.f08
@@ -0,0 +1,6 @@
+! RUN: %flang -### -flang-experimental-exec %s 2>&1 | FileCheck %s
+
+! CHECK: "{{.*}}flang-new" "-fc1" {{.*}} "/tmp/{{.*}}.o"
+! CHECK: "{{.*}}ld" {{.*}} "/tmp/{{.*}}.o"
+program f08
+end program f08
Index: flang/test/Driver/f03-suffix.f03
===
--- /dev/null
+++ flang/test/Driver/f03-suffix.f03
@@ -0,0 +1,6 @@
+! RUN: %flang -### -flang-experimental-exec %s 2>&1 | FileCheck %s
+
+! CHECK: "{{.*}}flang-new" "-fc1" {{.*}} "/tmp/{{.*}}.o"
+! CHECK: "{{.*}}ld" {{.*}} "/tmp/{{.*}}.o"
+program f03
+end program f03
Index: clang/lib/Driver/Types.cpp
===
--- clang/lib/Driver/Types.cpp
+++ clang/lib/Driver/Types.cpp
@@ -331,6 +331,10 @@
   .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)


Index: flang/test/Driver/f08-suffix.f08
===
--- /dev/null
+++ flang/test/Driver/f08-suffix.f08
@@ -0,0 +1,6 @@
+! RUN: %flang -### -flang-experimental-exec %s 2>&1 | FileCheck %s
+
+! CHECK: "{{.*}}flang-new" "-fc1" {{.*}} "/tmp/{{.*}}.o"
+! CHECK: "{{.*}}ld" {{.*}} "/tmp/{{.*}}.o"
+program f08
+end program f08
Index: flang/test/Driver/f03-suffix.f03
===
--- /dev/null
+++ flang/test/Driver/f03-suffix.f03
@@ -0,0 +1,6 @@
+! RUN: %flang -### -flang-experimental-exec %s 2>&1 | FileCheck %s
+
+! CHECK: "{{.*}}flang-new" "-fc1" {{.*}} "/tmp/{{.*}}.o"
+! CHECK: "{{.*}}ld" {{.*}} "/tmp/{{.*}}.o"
+program f03
+end program f03
Index: clang/lib/Driver/Types.cpp
===
--- clang/lib/Driver/Types.cpp
+++ clang/lib/Driver/Types.cpp
@@ -331,6 +331,10 @@
   .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)
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2023-03-11 Thread Valentin Clement via Phabricator via cfe-commits
clementval added a comment.

In D145845#4186607 , @awarzynski 
wrote:

> Thanks!
>
> In D145845#4186590 , @clementval 
> wrote:
>
>> Thanks. Can you add tests in `flang/test/Driver`?
>
> Hm, this is a `clangDriver` change rather than anything Flang specific 🤔 . 
> Btw, how does https://github.com/llvm/llvm-project/issues/61260 manifest to 
> you? I'm trying to figure out how to best test it (I couldn't find any other 
> tests for this specifically).

Cannot we just have a a .f03 file and compile it and see if we have an 
executable?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D145845/new/

https://reviews.llvm.org/D145845

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2023-03-11 Thread Andrzej Warzynski via Phabricator via cfe-commits
awarzynski added a comment.

Thanks!

In D145845#4186590 , @clementval 
wrote:

> Thanks. Can you add tests in `flang/test/Driver`?

Hm, this is a `clangDriver` change rather than anything Flang specific 🤔 . Btw, 
how does https://github.com/llvm/llvm-project/issues/61260 manifest to you? I'm 
trying to figure out how to best test it (I couldn't find any other tests for 
this specifically).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D145845/new/

https://reviews.llvm.org/D145845

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2023-03-11 Thread Valentin Clement via Phabricator via cfe-commits
clementval added a comment.

Thanks. Can you add tests in `flang/test/Driver`?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D145845/new/

https://reviews.llvm.org/D145845

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2023-03-11 Thread Shao-Ce SUN via Phabricator via cfe-commits
sunshaoce created this revision.
sunshaoce added reviewers: awarzynski, klausler, clementval, sscalpone.
Herald added a project: All.
sunshaoce requested review of this revision.
Herald added subscribers: cfe-commits, MaskRay.
Herald added a project: clang.

Fix issue #61260


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D145845

Files:
  clang/lib/Driver/Types.cpp


Index: clang/lib/Driver/Types.cpp
===
--- clang/lib/Driver/Types.cpp
+++ clang/lib/Driver/Types.cpp
@@ -331,6 +331,10 @@
   .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)


Index: clang/lib/Driver/Types.cpp
===
--- clang/lib/Driver/Types.cpp
+++ clang/lib/Driver/Types.cpp
@@ -331,6 +331,10 @@
   .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)
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits