Skip to content

[flang] Accept OPEN(...,CONVERT="SWAP") in semantics #79050

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 26, 2024
Merged

Conversation

klausler
Copy link
Contributor

The runtime implements CONVERT="SWAP", but semantics doesn't like it. Add it to the relevant table.

Fixes llvm-test-suite/Fortran/gfortran/regression/record_marker_1.f90, .../unf_io_convert_1.f90, .../unf_io_convert_2.f90, and .../unf_io_convert_3.f90.

The runtime implements CONVERT="SWAP", but semantics doesn't
like it.  Add it to the relevant table.

Fixes llvm-test-suite/Fortran/gfortran/regression/record_marker_1.f90,
.../unf_io_convert_1.f90, .../unf_io_convert_2.f90, and
.../unf_io_convert_3.f90.
@klausler klausler requested a review from vdonaldson January 22, 2024 20:19
@llvmbot llvmbot added flang Flang issues not falling into any other category flang:semantics labels Jan 22, 2024
@llvmbot
Copy link
Member

llvmbot commented Jan 22, 2024

@llvm/pr-subscribers-flang-semantics

Author: Peter Klausler (klausler)

Changes

The runtime implements CONVERT="SWAP", but semantics doesn't like it. Add it to the relevant table.

Fixes llvm-test-suite/Fortran/gfortran/regression/record_marker_1.f90, .../unf_io_convert_1.f90, .../unf_io_convert_2.f90, and .../unf_io_convert_3.f90.


Full diff: https://github.com/llvm/llvm-project/pull/79050.diff

1 Files Affected:

  • (modified) flang/lib/Semantics/check-io.cpp (+1-1)
diff --git a/flang/lib/Semantics/check-io.cpp b/flang/lib/Semantics/check-io.cpp
index 3cff6eca4542c7..ad89a9be5a290f 100644
--- a/flang/lib/Semantics/check-io.cpp
+++ b/flang/lib/Semantics/check-io.cpp
@@ -918,7 +918,7 @@ void IoChecker::CheckStringValue(IoSpecKind specKind, const std::string &value,
           // Open values; Close values are {"DELETE", "KEEP"}.
           {"NEW", "OLD", "REPLACE", "SCRATCH", "UNKNOWN"}},
       {IoSpecKind::Carriagecontrol, {"LIST", "FORTRAN", "NONE"}},
-      {IoSpecKind::Convert, {"BIG_ENDIAN", "LITTLE_ENDIAN", "NATIVE"}},
+      {IoSpecKind::Convert, {"BIG_ENDIAN", "LITTLE_ENDIAN", "NATIVE", "SWAP"}},
       {IoSpecKind::Dispose, {"DELETE", "KEEP"}},
   };
   auto upper{Normalize(value)};

@klausler klausler merged commit 320a519 into llvm:main Jan 26, 2024
@klausler klausler deleted the swap branch January 26, 2024 00:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flang:semantics flang Flang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants