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

via flang-commits flang-commits at lists.llvm.org
Thu Jan 25 16:28:17 PST 2024


Author: Peter Klausler
Date: 2024-01-25T16:28:12-08:00
New Revision: 320a5197a6d3a0929d0ade3b621769eaf120b203

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

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

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.

Added: 
    

Modified: 
    flang/lib/Semantics/check-io.cpp

Removed: 
    


################################################################################
diff  --git a/flang/lib/Semantics/check-io.cpp b/flang/lib/Semantics/check-io.cpp
index 3cff6eca4542c7a..ad89a9be5a290f5 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)};


        


More information about the flang-commits mailing list