[clang] [flang] [flang] Align `-x` language modes with `gfortran` (PR #130268)

2025-04-05 Thread David Truby via cfe-commits
=?utf-8?q?Iñaki?= Amatria Barral Message-ID: In-Reply-To: @@ -817,8 +817,13 @@ void Flang::ConstructJob(Compilation &C, const JobAction &JA, // 'flang -E' always produces output that is suitable for use as fixed form // Fortran. However it is only valid free form sourc

[clang] [flang] [flang] Align `-x` language modes with `gfortran` (PR #130268)

2025-03-31 Thread David Truby via cfe-commits
=?utf-8?q?Iñaki?= Amatria Barral Message-ID: In-Reply-To: @@ -863,6 +863,12 @@ static void parsePreprocessorArgs(Fortran::frontend::PreprocessorOptions &opts, (currentArg->getOption().matches(clang::driver::options::OPT_cpp)) ? PPMacrosFlag::Include

[clang] [flang] [flang] Align `-x` language modes with `gfortran` (PR #130268)

2025-03-31 Thread David Truby via cfe-commits
=?utf-8?q?Iñaki?= Amatria Barral Message-ID: In-Reply-To: @@ -817,8 +817,13 @@ void Flang::ConstructJob(Compilation &C, const JobAction &JA, // 'flang -E' always produces output that is suitable for use as fixed form // Fortran. However it is only valid free form sourc

[clang] [flang] [flang] Align `-x` language modes with `gfortran` (PR #130268)

2025-03-31 Thread David Truby via cfe-commits
=?utf-8?q?Iñaki?= Amatria Barral Message-ID: In-Reply-To: DavidTruby wrote: I've created a PR at #133775 cleaning up the meanings of the `-x` options in the compiler driver, which I believe resolves the above issue but leaves this fix in place. If you could check that it still works for you

[clang] [flang] [flang] Align `-x` language modes with `gfortran` (PR #130268)

2025-03-31 Thread David Truby via cfe-commits
=?utf-8?q?Iñaki?= Amatria Barral Message-ID: In-Reply-To: https://github.com/DavidTruby edited https://github.com/llvm/llvm-project/pull/130268 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cf

[clang] [flang] [flang] Align `-x` language modes with `gfortran` (PR #130268)

2025-03-31 Thread David Truby via cfe-commits
=?utf-8?q?Iñaki?= Amatria Barral Message-ID: In-Reply-To: https://github.com/DavidTruby edited https://github.com/llvm/llvm-project/pull/130268 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cf

[clang] [flang] [flang] Align `-x` language modes with `gfortran` (PR #130268)

2025-03-12 Thread Iñaki Amatria Barral via cfe-commits
https://github.com/inaki-amatria closed https://github.com/llvm/llvm-project/pull/130268 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang] Align `-x` language modes with `gfortran` (PR #130268)

2025-03-12 Thread Tarun Prabhu via cfe-commits
=?utf-8?q?I=C3=B1aki?= Amatria Barral Message-ID: In-Reply-To: https://github.com/tarunprabhu approved this pull request. Thanks for all the changes :-) https://github.com/llvm/llvm-project/pull/130268 ___ cfe-commits mailing list cfe-commits@lists.

[clang] [flang] [flang] Align `-x` language modes with `gfortran` (PR #130268)

2025-03-12 Thread Iñaki Amatria Barral via cfe-commits
https://github.com/inaki-amatria updated https://github.com/llvm/llvm-project/pull/130268 From def8ab8b16eab97ffc2669631fb84406842d41e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=C3=B1aki=20Amatria=20Barral?= Date: Fri, 7 Mar 2025 08:45:05 +0100 Subject: [PATCH 1/2] [flang] Remove implicit assu

[clang] [flang] [flang] Align `-x` language modes with `gfortran` (PR #130268)

2025-03-11 Thread David Truby via cfe-commits
=?utf-8?q?Iñaki?= Amatria Barral Message-ID: In-Reply-To: https://github.com/DavidTruby approved this pull request. This LGTM now when @tarunprabhu is happy, thanks for seeing this through despite my lengthy comments! This isn't to hold up this patch, but as a separate thought: I wonder if

[clang] [flang] [flang] Align `-x` language modes with `gfortran` (PR #130268)

2025-03-11 Thread David Truby via cfe-commits
=?utf-8?q?Iñaki?= Amatria Barral Message-ID: In-Reply-To: https://github.com/DavidTruby edited https://github.com/llvm/llvm-project/pull/130268 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cf

[clang] [flang] [flang] Align `-x` language modes with `gfortran` (PR #130268)

2025-03-11 Thread Iñaki Amatria Barral via cfe-commits
inaki-amatria wrote: > This LGTM now when @tarunprabhu is happy, thanks for seeing this through > despite my lengthy comments! Thank you for the quick review, David! I also appreciate your patience with my lengthy comments. I was so caught up in the fixed-form assumption that I failed to real

[clang] [flang] [flang] Align `-x` language modes with `gfortran` (PR #130268)

2025-03-11 Thread Iñaki Amatria Barral via cfe-commits
@@ -0,0 +1,35 @@ +program main + print *, __FILE__, __LINE__ +end + +! This test verifies that `flang`'s `-x` options behave like `gfortran`'s. +! Specifically: +! - `-x f95` should process the file based on its extension unless overridden. +! - `-x f95-cpp-input` should behave l

[clang] [flang] [flang] Align `-x` language modes with `gfortran` (PR #130268)

2025-03-11 Thread Iñaki Amatria Barral via cfe-commits
https://github.com/inaki-amatria updated https://github.com/llvm/llvm-project/pull/130268 From 3753b14814c845ab695ffbe985f8b2fd5a478de2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=C3=B1aki=20Amatria=20Barral?= Date: Fri, 7 Mar 2025 08:45:05 +0100 Subject: [PATCH 1/2] [flang] Remove implicit assu

[clang] [flang] [flang] Align `-x` language modes with `gfortran` (PR #130268)

2025-03-07 Thread Tarun Prabhu via cfe-commits
=?utf-8?q?Iñaki?= Amatria Barral Message-ID: In-Reply-To: @@ -0,0 +1,35 @@ +program main + print *, __FILE__, __LINE__ +end + +! This test verifies that `flang`'s `-x` options behave like `gfortran`'s. +! Specifically: +! - `-x f95` should process the file based on its extensi

[clang] [flang] [flang] Align `-x` language modes with `gfortran` (PR #130268)

2025-03-07 Thread Iñaki Amatria Barral via cfe-commits
@@ -0,0 +1,35 @@ +program main + print *, __FILE__, __LINE__ +end + +! This test verifies that `flang`'s `-x` options behave like `gfortran`'s. +! Specifically: +! - `-x f95` should process the file based on its extension unless overridden. +! - `-x f95-cpp-input` should behave l

[clang] [flang] [flang] Align `-x` language modes with `gfortran` (PR #130268)

2025-03-07 Thread Iñaki Amatria Barral via cfe-commits
@@ -0,0 +1,12 @@ +! This test verifies that using `-x f95` does not cause the driver to assume +! this file is in fixed-form. + +program main + print *, "Hello, World!" +end + +! RUN: %flang -### -x f95 %s 2>&1 | FileCheck --check-prefix=PRINT-PHASES %s +! PRINT-PHASES-NOT: -ffix

[clang] [flang] [flang] Align `-x` language modes with `gfortran` (PR #130268)

2025-03-07 Thread Iñaki Amatria Barral via cfe-commits
https://github.com/inaki-amatria updated https://github.com/llvm/llvm-project/pull/130268 From 3753b14814c845ab695ffbe985f8b2fd5a478de2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=C3=B1aki=20Amatria=20Barral?= Date: Fri, 7 Mar 2025 08:45:05 +0100 Subject: [PATCH 1/2] [flang] Remove implicit assu

[clang] [flang] [flang] Align `-x` language modes with `gfortran` (PR #130268)

2025-03-07 Thread Tarun Prabhu via cfe-commits
=?utf-8?q?Iñaki?= Amatria Barral Message-ID: In-Reply-To: https://github.com/tarunprabhu edited https://github.com/llvm/llvm-project/pull/130268 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/c

[clang] [flang] [flang] Align `-x` language modes with `gfortran` (PR #130268)

2025-03-07 Thread Tarun Prabhu via cfe-commits
=?utf-8?q?Iñaki?= Amatria Barral Message-ID: In-Reply-To: @@ -0,0 +1,12 @@ +! This test verifies that using `-x f95` does not cause the driver to assume +! this file is in fixed-form. + +program main + print *, "Hello, World!" +end + +! RUN: %flang -### -x f95 %s 2>&1 | FileCh

[clang] [flang] [flang] Align `-x` language modes with `gfortran` (PR #130268)

2025-03-07 Thread Tarun Prabhu via cfe-commits
=?utf-8?q?I=C3=B1aki?= Amatria Barral Message-ID: In-Reply-To: https://github.com/tarunprabhu commented: Thanks for continuing to see this through https://github.com/llvm/llvm-project/pull/130268 ___ cfe-commits mailing list cfe-commits@lists.llvm.o

[clang] [flang] [flang] Align `-x` language modes with `gfortran` (PR #130268)

2025-03-07 Thread Tarun Prabhu via cfe-commits
=?utf-8?q?Iñaki?= Amatria Barral Message-ID: In-Reply-To: @@ -0,0 +1,35 @@ +program main + print *, __FILE__, __LINE__ +end + +! This test verifies that `flang`'s `-x` options behave like `gfortran`'s. +! Specifically: +! - `-x f95` should process the file based on its extensi

[clang] [flang] [flang] Align `-x` language modes with `gfortran` (PR #130268)

2025-03-07 Thread Iñaki Amatria Barral via cfe-commits
https://github.com/inaki-amatria created https://github.com/llvm/llvm-project/pull/130268 This PR addresses some of the issues described in https://github.com/llvm/llvm-project/issues/127617. Key changes: - Stop assuming fixed-form for `-x f95` unless the input is a `.i` file. This change ens

[clang] [flang] [flang] Align `-x` language modes with `gfortran` (PR #130268)

2025-03-07 Thread via cfe-commits
=?utf-8?q?Iñaki?= Amatria Barral Message-ID: In-Reply-To: llvmbot wrote: @llvm/pr-subscribers-flang-driver @llvm/pr-subscribers-clang-driver Author: Iñaki Amatria Barral (inaki-amatria) Changes This PR addresses some of the issues described in https://github.com/llvm/llvm-project/issue