diff --git a/Fortran/CMakeLists.txt b/Fortran/CMakeLists.txt --- a/Fortran/CMakeLists.txt +++ b/Fortran/CMakeLists.txt @@ -8,3 +8,12 @@ # directory add_subdirectory(UnitTests) add_subdirectory(SNAP) + +# The gfortran subdirectory contains tests imported as-is from gfortran's +# test suite. These have not been widely tested, so they are only enabled for +# certain combinations of platforms and architectures. +if (NOT WIN32 AND NOT APPLE) + if (ARCH MATCHES "x86" OR ARCH MATCHES "AArch64") + add_subdirectory(gfortran) + endif() +endif() diff --git a/Fortran/gfortran/CMakeLists.txt b/Fortran/gfortran/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/Fortran/gfortran/CMakeLists.txt @@ -0,0 +1,300 @@ +cmake_minimum_required(VERSION 3.24.0) + +include(CheckFortranCompilerFlag) + +# NOTE: flang does not currently (as of 2023/03/20) support the -w flag. If +# support for the flag is added, this should be removed. +remove_definitions(-w) + +# If the test suite was configured by adding -flang-experimental-exec, remove +# that flag from the default compilation flags. It is only needed at link-time +# anyway, and for that it is explicitly added to those targets that need it. +# +# NOTE: This should be removed once the -flang-experimental-exec flag is no +# longer needed. +string(REPLACE "-flang-experimental-exec" "" TMP_FFLAGS "${CMAKE_Fortran_FLAGS}") +set(CMAKE_Fortran_FLAGS "${TMP_FFLAGS}") + +# This option is added because as of 2023/03/20, several tests in this +# directory have been disabled. Some of them exercise unsupported non-standard +# extensions, others trigger a "not yet implemented" assertion while some cause +# flang to crash. This option forces all the tests to build and can be used to +# determine if any of the disabled tests can be enabled. +option(TEST_SUITE_FORTRAN_FORCE_ALL_TESTS + "Build and run all gfortran tests, including those in the 'unsupported', 'unimplemented', 'skipped', and 'failing' categories." + OFF) + +# Since the FORCE_ALL_TESTS option is a bit too blunt, there are some other +# options to force building some subsets of the disabled tests. + +# The 'unsupported' tests exercise non-standard extensions that are not +# currently supported. But there is a chance some may be in the future, in which +# case, it may be worthwhile seeing if any can be removed from the list and +# enabled permanently. +option(TEST_SUITE_FORTRAN_FORCE_UNSUPPORTED_TESTS + "Build and run all 'unsupported' gfortran tests. These usually test non-standard extensions." + OFF) + +# The 'unimplemented' tests trigger a "not yet implemented" assertion at +# compile-time. If those features are implemented, enabling those tests may help +# in identifying those that can be removed from the list and permanently enabled +# because the root cause has been addressed. +option(TEST_SUITE_FORTRAN_FORCE_UNIMPLEMENTED_TESTS + "Build and run all 'unimplemented' gfortran tests. These are tests that fail at build-time because of unimplemented features in flang." + OFF) + +# The 'skipped' tests cause flang to crash at compile-time for "non-obvious" +# reasons. They could be related to unimplemented features, or they could be +# bugs in the compiler. In any case, enabling them may help identify those tests +# that can be removed from the list and permanently enabled because the root +# cause has been addressed. +option(TEST_SUITE_FORTRAN_FORCE_SKIPPED_TESTS + "Build and run all 'skipped' gfortran tests. These are tests that cause flang to crash." + OFF) + +# The 'failing' tests fail to pass either because of a bug somewhere in the +# compiler or the runtime. Enabling these tests may help identify those tests +# that can be removed from the list and permanently enabled because the root +# cause has been addressed. +option(TEST_SUITE_FORTRAN_FORCE_FAILING_TESTS + "Build and run all 'failing' tests. These tests failed at runtime, perhaps due to bugs in the code generator or bugs/unimplemented features in the runtime." + OFF) + +# The ISO_Fortran_binding.h file is required to run some of the tests. This +# header is copied to ${CMAKE_INSTALL_PREFIX}/include/flang at flang install +# time which can be found automatically. If the compiler being tested here is +# not installed, that file will not be found. In that case, the path to it must +# be provided explicitly. +set(TEST_SUITE_FORTRAN_ISO_C_HEADER_DIR "" CACHE STRING + "Path to the directory containing ISO_Fortran_bindings.h header file.") + +# The following cause errors if they are passed to flang via FFLAGS +set(FLANG_ERRORING_FFLAGS + -fallow-invalid-boz + -fdec + -fdec-format-defaults + -fdec-static + -fdec-structure + # Not sure if the -fdefault-* options will be supported. Maybe in a different + # form in which case, this will have to be modified to accommodate those. + -fdefault-real-10 + -fdefault-real-16 + -fdump-ipa-cp-details + -fdump-ipa-fnsummary-details + -fdump-ipa-inline-details + -fdump-rtl-expand + -fdump-tree-all + -fdump-tree-cunroll-details + -fdump-tree-cunrolli-details + -fdump-tree-fre1 + -fdump-tree-gimple + -fdump-tree-ifcvt + -fdump-tree-lversion-details + -fdump-tree-omplower + -fdump-tree-optimized + -fdump-tree-original + -fdump-tree-pcom-details + -fdump-tree-pre-details + -fdump-tree-profile-estimate + -fdump-tree-reassoc1 + -fdump-tree-vect-details + -ff2c + -finline-matmul-limit=0 + -finline-matmul-limit=10 + -finline-matmul-limit=100 + -finline-matmul-limit=1000 + -finline-matmul-limit=2 + -finline-matmul-limit=30 + -fipa-cp + -fipa-cp-clone + -fipa-pta + -fipa-reference + -fno-dec + -fno-guess-branch-probability + -fno-ipa-cp + -fno-ipa-modref + -fno-ipa-sra + -fno-pad-source + -fno-tree-ccp + -fno-tree-forwprop + -fno-tree-fre + -fno-tree-loop-optimize + -fno-tree-loop-vectorize + -fpad-source + -fset-g77-defaults + -ftest-forall-temp + -ftree-loop-distribution + -ftree-loop-vectorize + -ftree-pre + -ftree-slp-vectorize + -ftree-tail-merge + -ftree-vectorize + -ftree-vrp + -mdejagnu-cpu=power4 + # -Os might eventually be supported, so this might also need to be removed + # at some point + -Og + -Os + # At some point, if we ever support explicit standard flags, some of these + # should be removed. + -std=gnu + -std=legacy + -std=f95 + -std=f2003 + -std=f2008 + -std=f2008ts + # At the time of writing, -W warnings are not supported. flang errors out + # saying that only -Werror is supported. + -Wall + -Wampersand + -Wanalyzer-too-complex + -Warray-bounds + -Warray-temporaries + -Wconversion + -Wconversion-extra + -Werner + -Werror + -Wextra + -Wfunction-elimination + -Wimplicit-procedure + -Wintrinsic-shadow + -Wintrinsics-std + -Wline-truncation + -Wno-all + -Wno-analyzer-null-dereference + -Wno-analyzer-possible-null-dereference + -Wno-analyzer-too-complex + -Wno-analyzer-use-of-uninitialized-value + -Wno-c-binding-type + -Wno-complain-wrong-lang + -Wno-error + -Wno-intrinsic-shadow + -Wno-intrinsics-std + -Wno-lto-type-mismatch + -Wno-tabs + -Wno-underflow + -Wrealloc-lhs + -Wrealloc-lhs-all + -Wreturn-type + -Wstringop-overflow + -Wsurprising + -Wtabs + -Wuninitialized + -Wunused + -Wunused-dummy-argument + -Wunused-function + -Wunused-parameter + -Wunused-variable + -Wzerotrip +) + +set(HEADER_SEARCH_PATH "${TEST_SUITE_FORTRAN_ISO_C_HEADER_DIR}") +if (NOT HEADER_SEARCH_PATH) + get_filename_component(Fortran_BINDIR ${CMAKE_Fortran_COMPILER} DIRECTORY) + get_filename_component(Fortran_PREFIX ${Fortran_BINDIR} DIRECTORY) + + set(HEADER_SEARCH_PATH "${Fortran_PREFIX}/include/flang") +endif() + +find_file(ISO_FORTRAN_C_HEADER + ISO_Fortran_binding.h + PATHS ${HEADER_SEARCH_PATH} + REQUIRED) + +get_filename_component(ISO_FORTRAN_C_HEADER_DIR + "${ISO_FORTRAN_C_HEADER}" + DIRECTORY) + +# This pulls out options in dg-options into `${Variable}` +function(gfortran_dg_options_fflags Variable File) + # Some files have dg-options which we need to pick up. These should be in + # the first line but often aren't. + # + # We also need to be careful not to pick up target-specific dg-options. + set(DG_FFLAGS) + + file(STRINGS ${File} FileLines) + foreach(FileLine ${FileLines}) + # Looking for `dg-options "..."` or `dg-additional-options "..."` without + # `{ target` afterwards (ignoring spaces). + if(FileLine MATCHES "dg-(additional-)?options [{]?[ ]*\"([^\"]*)\"[ ]*[}]?(.*)") + # This is needed to turn the string into a list of FFLAGS + separate_arguments(FILE_FFLAGS UNIX_COMMAND ${CMAKE_MATCH_2}) + # This does the negative lookahead for `{ target` anywhere in the rest of + # the line + if(NOT "${CMAKE_MATCH_3}" MATCHES "{ +target") + list(APPEND DG_FFLAGS ${FILE_FFLAGS}) + endif() + endif() + endforeach() + + # Remove any flags that will cause flang to raise an error. + if (DG_FFLAGS) + list(REMOVE_ITEM DG_FFLAGS ${FLANG_ERRORING_FFLAGS}) + endif() + + # Set the parent scope variable + set(${Variable} ${DG_FFLAGS} PARENT_SCOPE) +endfunction() + +function(gfortran_execute_test File) + cmake_parse_arguments(GFORTRAN "" "PREFIX" "FFLAGS;LDFLAGS;DEPFILES" ${ARGN}) + # There are a few tests with duplicate filenames, and CMake wants all target + # names to be unique, so we add a disambiguator to the target name. The + # disambiguator uses the path of the file relative to the top-level directory + # containing all the tests from the gfortran test suite. + + # The ${File} argument is guaranteed to be the absolute path to the source + # file. + string(REPLACE "${PROJECT_SOURCE_DIR}/Fortran/gfortran/" "" Name "${File}") + + # Replace any '/' separators with 2 underscores. Just replacing it by a single + # underscore results in conflicts. For instance, there is a conflict between + # regression/coarray_ptr_comp_2.f08 and regression/coarray/ptr_comp_2.f08 + # which are unrelated tests. Other such conflicts are probably also unrelated. + string(REPLACE "/" "__" Name "${Name}") + + # Retain the extension of the source file in the final target name because + # there are cases where two source files with the same basename but different + # extensions and they, too, represent completely different and unrelated + # tests. + string(REPLACE "." "_" Name "${Name}") + + set(_target "${GFORTRAN_PREFIX}-${Name}") + + gfortran_dg_options_fflags(DG_FFLAGS ${File}) + + # Add any flags that were requested + list(APPEND FFLAGS ${DG_FFLAGS} ${GFORTRAN_FFLAGS}) + list(APPEND LDFLAGS ${GFORTRAN_LDFLAGS}) + + llvm_test_executable_no_test(${_target} ${File} ${GFORTRAN_DEPFILES}) + llvm_test_run() + + llvm_add_test_for_target(${_target}) + target_include_directories(${_target} PRIVATE ${ISO_FORTRAN_C_HEADER_DIR}) + + # This is a workaround because cmake does not currently recognize the .f03 + # and .f08 extensions. A patch to fix cmake has been accepted and the fix + # should be available in CMake 3.27. It might be better to check the CMake + # CMake version and do this conditionally. + list(APPEND SOURCES ${File}) + list(APPEND SOURCES ${GFORTRAN_DEPFILES}) + foreach(Source ${SOURCES}) + get_filename_component(Ext ${Source} LAST_EXT) + if("${Ext}" STREQUAL ".f03" OR + "${Ext}" STREQUAL ".F03" OR + "${Ext}" STREQUAL ".f08" OR + "${Ext}" STREQUAL ".F08") + set_source_files_properties(${Source} PROPERTIES LANGUAGE Fortran) + endif() + endforeach() + + # NOTE: This should be removed when the -flang-experimental-exec flag is no + # longer needed. + target_link_options(${_target} PRIVATE -flang-experimental-exec) + set_target_properties(${_target} PROPERTIES LINKER_LANGUAGE Fortran) +endfunction() + +add_subdirectory(regression) +add_subdirectory(torture) diff --git a/Fortran/gfortran/COPYING b/Fortran/gfortran/COPYING new file mode 100644 --- /dev/null +++ b/Fortran/gfortran/COPYING @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/Fortran/gfortran/COPYING3 b/Fortran/gfortran/COPYING3 new file mode 100644 --- /dev/null +++ b/Fortran/gfortran/COPYING3 @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/Fortran/gfortran/LICENSE.txt b/Fortran/gfortran/LICENSE.txt new file mode 100644 --- /dev/null +++ b/Fortran/gfortran/LICENSE.txt @@ -0,0 +1,2 @@ +The testcases in this directory and its subdirectories are covered by the GPL. +See the files whose names start with COPYING for copying permission. diff --git a/Fortran/gfortran/README.md b/Fortran/gfortran/README.md new file mode 100644 --- /dev/null +++ b/Fortran/gfortran/README.md @@ -0,0 +1,118 @@ +## Tests from the gfortran test suite ## + +This is the top-level directory for tests imported from +[GCC](https://github.com/gcc-mirror/gcc). The test files are contained within +two subdirectories: + + - `regression`: Contains the gfortran [tests](https://github.com/gcc-mirror/gcc/tree/master/gcc/testsuite/gfortran.dg). + - `torture`: Contains the gfortran [torture tests](https://github.com/gcc-mirror/gcc/tree/master/gcc/testsuite/gfortran.fortran-torture). + +The tests in both `regression` (and its subdirectories) and `torture` can be +classified roughly as _compile_ tests and _execute_ tests. The _compile_ tests +generally check the compiler's error/warning messages and, in some cases, +optimization logs. The _execute_ tests are end-to-end tests that check the +behavior of the binary produced by the compiler. + +Currently, only the _execute_ tests are supported in both `regression` and +`torture`. + +Of the supported tests, a number of tests have been disabled. There are four +categories of such tests: + + - *Unsupported*: These are tests that use non-standard extensions/intrinsics + that are not currently supported by flang. Unless those non-standard + features are supported in the future, these tests will never be enabled. + + - *Unimplemented*: These tests hit a "not yet implemented" assertion within + flang. + + - *Skipped*: These tests cause some form of compiler error. Some trigger an + assertion within the compiler. Others are legal Fortran programs, but + nevertheless cause a semantic error, most likely due to unimplemented + features. + + - *Failing*: These tests fail at runtime - some crash on execution, others + produce incorrect/unexpected output. This could be a result of a bug in the + compiler/code generator or the runtime. + +Over time, the number of tests in the *unimplemented*, *skipped*, and *failing* +categories should decrease. Eventually, only the *unsupported* category should +remain. + + +### _Compile_ tests ### + +These tests are currently not supported. + + +### _Execute tests_ ### + +The _execute_ tests are built when the whole test suite is built and executed +when the tests are run. The *unsupported*, *unimplemented*, and *skipped* tests +fail to build for the reasons described above. The *failing* tests do build. + + +### Usage ### + +As of 18-Apr-2023, the `-flang-experimental-exec` flag may need to be used when +configuring and compiling these tests. This can be passed to `cmake` via +`CMAKE_Fortran_FLAGS`. + +By default, the *unsupported*, *unimplemented*, *skipped*, and *failing* tests +are not run. The intention is that all tests in the test suite should pass by +default. + +In order to enable the disabled tests, one or more of the following options can +be passed to `cmake`: + + - `TEST_SUITE_FORTRAN_FORCE_ALL_TESTS`: Enable all disabled tests. + - `TEST_SUITE_FORTRAN_FORCE_UNSUPPORTED_TESTS`: Enable only the *unsupported* tests. + - `TEST_SUITE_FORTRAN_FORCE_UNIMPLEMENTED_TESTS`: Enable only the *unimplemented* tests. + - `TEST_SUITE_FORTRAN_FORCE_SKIPPED_TESTS`: Enable only the *skipped* tests. + - `TEST_SUITE_FORTRAN_FORCE_FAILING_TESTS`: Enable only the *failing* tests. + +Some of the tests require the `ISO_Fortran_binding.h` header file. `cmake` will +look for this file in the `include` directory of the `flang` installation +prefix. When running the test from a build directory, the file will probably +not be found. In that case, the `TEST_SUITE_FORTRAN_ISO_C_HEADER_DIR` flag +can be passed to `cmake` with the value being the directory containing the +`ISO_Fortran_binding.h` file to use. + +A `cmake` command that would only run the Fortran tests in the test-suite is +shown below + +``` +cmake -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_C_COMPILER=/path/to/clang \ + -DCMAKE_CXX_COMPILER=/path/to/clang++ \ + -DCMAKE_Fortran_COMPILER=/path/to/flang-new \ + -DCMAKE_Fortran_FLAGS=-flang-experimental-exec \ + -DTEST_SUITE_FORTRAN=On \ + -DTEST_SUITE_SUBDIRS=Fortran \ + -DTEST_SUITE_FORTRAN_ISO_C_HEADER_DIR=/path/to/dir/containing/header \ + /path/to/source/of/llvm-test-suite/ +``` + +The tests can be run as shown from the `llvm-test-suite` build directory: + +``` +/path/to/llvm-lit -v -o report.json . +``` + +It may be necessary to set the `NO_STOP_MESSAGE` environment variable to +avoid tests failures in `llvm-test-suite/Fortran/UnitTests/fcvs21_f95`. These +are unrelated to the gfortran tests here. + + +### Notes for developers/maintainers ### + +Since `flang` is under active development, it is expected that features will be +implemented at a steady pace. The relevant tests in this directory should be +enabled. This would involve building the test suite with one of the +`TEST_SUITE_FORTRAN_*` flags described above. + +The test files should be kept in sync with gfortran. This needs to be done +manually periodically. + +The test files in `regression` and `torture` *must not* be modified. + diff --git a/Fortran/gfortran/regression/CMakeLists.txt b/Fortran/gfortran/regression/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/Fortran/gfortran/regression/CMakeLists.txt @@ -0,0 +1,1877 @@ +#===------------------------------------------------------------------------===# +# +# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +# See https://llvm.org/LICENSE.txt for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +# +#===------------------------------------------------------------------------===# + +# Creates a test from each valid test file in the current source directory. Each +# argument to a function is a list. If a test file is in any of the lists, a +# test will not be created from it. +function(add_tests UnsupportedTests UnimplementedTests SkippedTests FailingTests) + # This will just get all the Fortran source files in the directory. Since + # the tests here are a mix of single-source and multi-source tests, this will + # include files that are dependencies of some "main" test file as well. Those + # will be filtered out later. + file(GLOB AllFiles CONFIGURE_DEPENDS LIST_DIRECTORIES false + *.f* + *.F* + ) + + set(TestsToSkip) + + # There is still a chance that some of the unsupported tests may need to be + # enabled, for instance if the non-standard extensions that they exercise are + # supported due to user demand. + if (NOT TEST_SUITE_FORTRAN_FORCE_ALL_TESTS AND + NOT TEST_SUITE_FORTRAN_FORCE_UNSUPPORTED_TESTS) + list(APPEND TestsToSkip ${UnsupportedTests}) + endif() + + # For the remaining tests, there is cause to build and run the skipped, failing + # and unimplemented tests since some could be enabled once some feature is + # implemented. Eventually, all the TEST_SUITE_FORTRAN_FORCE_* options (perhaps + # with the exception of TEST_SUITE_FORTRAN_FORCE_UNSUPPORTED_TESTS) should + # become redundant and removed. + if (NOT TEST_SUITE_FORTRAN_FORCE_ALL_TESTS AND + NOT TEST_SUITE_FORTRAN_FORCE_UNIMPLEMENTED_TESTS) + list(APPEND TestsToSkip ${UnimplementedTests}) + endif() + + if (NOT TEST_SUITE_FORTRAN_FORCE_ALL_TESTS AND + NOT TEST_SUITE_FORTRAN_FORCE_FAILING_TESTS) + list(APPEND TestsToSkip ${FailingTests}) + endif() + + if (NOT TEST_SUITE_FORTRAN_FORCE_ALL_TESTS AND + NOT TEST_SUITE_FORTRAN_FORCE_SKIPPED_TESTS) + list(APPEND TestsToSkip ${SkippedTests}) + endif() + + foreach(TestToSkip ${TestsToSkip}) + list(REMOVE_ITEM AllFiles ${TestToSkip}) + endforeach() + + # For now, only the execute tests are supported. Those have a "{ dg-do run }" + # or a "{ dg-lto-do run }" directive. + foreach(File ${AllFiles}) + set(MAIN) + set(ADDITIONAL_SOURCES) + set(ADDITIONAL_FFLAGS) + set(ADDITIONAL_LDFLAGS) + + file(STRINGS ${File} FileLines) + foreach(FileLine ${FileLines}) + if(FileLine MATCHES "^.*[{][ ]*dg-(lto-)?do[ ]*([A-Za-z0-9]+).*[}].*$") + # If this is not a main file for an execute test, just move on to the + # next file. + if (NOT ${CMAKE_MATCH_2} MATCHES "run") + break() + else() + set(MAIN "${File}") + endif() + elseif(FileLine MATCHES "dg-additional-sources[ ]*[\"]?(.+)[\"]?[ ]*[}]") + separate_arguments(ADDITIONAL_SOURCES UNIX_COMMAND ${CMAKE_MATCH_1}) + list(TRANSFORM ADDITIONAL_SOURCES STRIP) + endif() + endforeach() + + if (MAIN) + gfortran_execute_test(${MAIN} + PREFIX "gfortran-regression-execute" + FFLAGS ${ADDITIONAL_FFLAGS} + LDFLAGS ${ADDITIONAL_LDFLAGS} + DEPFILES ${ADDITIONAL_SOURCES}) + endif() + endforeach() +endfunction() + +# Some tests in the suite use non-standard features that are supported in +# gfortran but are not (and might never be) supported by flang. But if they are, +# they should be moved out of here. +file(GLOB Unsupported CONFIGURE_DEPENDS + # -------------------------------------------------------------------------- + # + # This tests the ability of gfortran to emit code with calling conventions + # compatible with g77 and f2c. These will probably never be relevant to + # flang. + f2c_4.f90 + value_4.f90 + + # -------------------------------------------------------------------------- + # + # These test/use GNU extensions that are not currently supported by Flang. + # + # TODO: Some of the tests may actually just use a GNU intrinsic during the + # process of testing some other functionality. It may be worthwhile to + # include a version elsewhere in this repo which tests that same functionality + # but without using any GNU extensions. + # + backtrace_1.f90 # backtrace + complex_intrinsic_1.f90 # complex + dec_io_2.f90 # fseek + dec_io_2a.f90 # fseek + fgetc_1.f90 # fgetc, fputc + fgetc_2.f90 # fgetc, fputc + fseek.f90 # fseek + ftell_1.f90 # ftell + ftell_2.f90 # ftell + ftell_3.f90 # ftell + inquire_10.f90 # getcwd + int_conv_1.f90 # int2, int8 + itime_idate_1.f # itime, idate + itime_idate_2.f # itime, idate + list_read_9.f90 # fputc + ltime_gmtime_1.f90 # time, ltime, gmtime + ltime_gmtime_2.f90 # time, ltime, gmtime + malloc_free_1.f90 # malloc, free + mclock.f90 # mclock, mclock8 + open_errors.f90 # chmod, getuid + open_new.f90 # unlink + secnds.f # secnds + secnds-1.f # secnds + stat_1.f90 # stat, fstat, lstat, getuid, getgid + stat_2.f90 # stat, fstat, lstat, getuid, getgid + transfer_array_intrinsic_2.f90 # rand +) + +# These tests are skipped because they hit a 'not yet implemented' assertion +# in flang and thus fail to compile. They should be removed from here when the +# corresponding feature is implemented. Eventually, this variable should be +# removed altogether once all the missing features are implemented. +file(GLOB Unimplemented CONFIGURE_DEPENDS + # unimplemented: assumed rank in procedure interface. + ISO_Fortran_binding_1.f90 + ISO_Fortran_binding_13.f90 + ISO_Fortran_binding_14.f90 + ISO_Fortran_binding_16.f90 + ISO_Fortran_binding_3.f90 + ISO_Fortran_binding_6.f90 + ISO_Fortran_binding_9.f90 + PR100029.f90 + PR100097.f90 + PR100098.f90 + PR100915.f90 + PR93963.f90 + PR94022.f90 + PR95196.f90 + PR96726.f90 + PR96727.f90 + PR96728.f90 + PR97046.f90 + assumed_rank_12.f90 + assumed_rank_18.f90 + assumed_rank_19.f90 + assumed_rank_20.f90 + assumed_type_9.f90 + interface_49.f90 + is_contiguous_2.f90 + pr84088.f90 + select_rank_5.f90 + sizeof_4.f90 + sizeof_6.f90 + + # unimplemented: procedure pointers + dummy_procedure_7.f90 + elemental_dependency_4.f90 + internal_dummy_3.f08 + optional_absent_7.f90 + optional_absent_8.f90 + pointer_check_1.f90 + pointer_check_2.f90 + pointer_check_3.f90 + pointer_check_4.f90 + pointer_init_10.f90 + pointer_init_4.f90 + pointer_init_5.f90 + pr78719_1.f90 + proc_ptr_1.f90 + proc_ptr_18.f90 + proc_ptr_21.f90 + proc_ptr_22.f90 + proc_ptr_23.f90 + proc_ptr_25.f90 + proc_ptr_26.f90 + proc_ptr_3.f90 + proc_ptr_5.f90 + proc_ptr_51.f90 + proc_ptr_comp_8.f90 + proc_ptr_comp_9.f90 + proc_ptr_result_3.f90 + + # unimplemented: procedure pointer results + pointer_check_5.f90 + proc_ptr_12.f90 + proc_ptr_result_7.f90 + + # unimplemented: procedure pointer arguments + proc_ptr_10.f90 + proc_ptr_19.f90 + proc_ptr_20.f90 + proc_ptr_36.f90 + proc_ptr_6.f90 + proc_ptr_7.f90 + proc_ptr_comp_2.f90 + submodule_30.f08 + + # unimplemented: procedure components + proc_ptr_48.f90 + proc_ptr_comp_1.f90 + proc_ptr_comp_11.f90 + proc_ptr_comp_13.f90 + proc_ptr_comp_14.f90 + proc_ptr_comp_18.f90 + proc_ptr_comp_19.f90 + proc_ptr_comp_29.f90 + proc_ptr_comp_34.f90 + proc_ptr_comp_5.f90 + structure_constructor_11.f90 + + # unimplemented: support for polymorphic types. + ISO_Fortran_binding_17.f90 + PR100120.f90 + PR100245.f90 + PR95331.f90 + alloc_comp_deep_copy_1.f03 + allocate_with_source_18.f03 + allocate_with_source_8.f08 + associate_18.f08 + associate_20.f03 + associate_8.f03 + alloc_comp_class_2.f90 + allocate_alloc_opt_10.f90 + allocate_with_source_26.f90 + associate_13.f90 + associate_48.f90 + associated_6.f90 + associated_target_4.f90 + character_workout_1.f90 + character_workout_4.f90 + class_1.f03 + class_18.f03 + class_26.f03 class_35.f90 + class_48.f90 + class_46.f03 + class_6.f03 + class_62.f90 + class_63.f90 + class_66.f90 + class_allocate_1.f03 + class_allocate_13.f90 + class_allocate_18.f90 + class_allocate_19.f03 + class_allocate_21.f90 + class_allocate_22.f90 + class_allocate_23.f08 + class_allocate_25.f90 + class_allocate_3.f03 + class_allocate_4.f03 + class_allocate_5.f90 + class_allocate_6.f03 + class_array_1.f03 + class_array_15.f03 + class_array_14.f90 + class_array_2.f03 + class_array_20.f03 + class_array_3.f03 + class_array_8.f03 + class_dummy_1.f03 + class_nameclash.f90 + class_result_5.f90 + class_result_6.f90 + class_to_type_1.f03 + class_to_type_4.f90 + coarray_allocate_2.f08 + coarray_allocate_3.f08 + coarray_allocate_5.f08 + dependency_53.f90 + dependency_60.f90 + dynamic_dispatch_10.f03 + elemental_optional_args_5.f03 + exit_3.f08 + extends_type_of_1.f03 + extends_type_of_2.f03 + finalize_37.f90 + implicit_class_1.f90 + move_alloc_13.f90 + move_alloc_14.f90 + move_alloc_2.f90 + move_alloc_5.f90 + pointer_array_5.f90 + pointer_array_8.f90 + pointer_array_component_3.f90 + pointer_check_14.f90 + pointer_intent_4.f90 + pr100551.f90 + pr108010.f90 + pr48958.f90 + pr78092.f90 + pr86328.f90 + pr86760.f90 + pr94397.F90 + proc_ptr_52.f90 + proc_ptr_comp_pass_3.f90 + realloc_on_assign_27.f08 + realloc_on_assign_31.f90 + same_type_as_2.f03 + select_type_13.f03 + select_type_14.f03 + select_type_19.f03 + select_type_2.f03 + select_type_26.f03 + select_type_27.f03 + select_type_3.f03 + select_type_35.f03 + select_type_37.f03 + select_type_39.f03 + select_type_5.f03 + select_type_6.f03 + select_type_7.f03 + select_type_8.f03 + select_type_4.f90 + select_type_42.f90 + select_type_44.f90 + select_type_48.f90 + select_type_49.f90 + select_type_50.f90 + storage_size_1.f08 + storage_size_3.f08 + structure_constructor_13.f03 + transfer_class_3.f90 + type_to_class_1.f03 + type_to_class_2.f03 + type_to_class_3.f03 + type_to_class_5.f03 + unlimited_polymorphic_14.f90 + unlimited_polymorphic_17.f90 + unlimited_polymorphic_20.f90 + unlimited_polymorphic_21.f90 + unlimited_polymorphic_22.f90 + unlimited_polymorphic_24.f03 + unlimited_polymorphic_3.f03 + unlimited_polymorphic_30.f03 + unlimited_polymorphic_32.f03 + unlimited_polymorphic_5.f90 + unlimited_polymorphic_6.f90 + + # unimplemented: BIND (C) internal procedure. + ISO_Fortran_binding_19.f90 + PR93308.f90 + array_reference_3.f90 + bind_c_char_2.f90 + bind_c_char_3.f90 + bind_c_char_4.f90 + bind_c_char_5.f90 + internal_dummy_4.f08 + + # unimplemented: BIND(C) module variable linkage + bind_c_dts.f90 + bind_c_vars.f90 + global_vars_c_init.f90 + implicit_pure_5.f90 + proc_ptr_8.f90 + + # unimplemented: character array expression temp with dynamic length. + actual_array_constructor_2.f90 + array_constructor_17.f90 + associate_35.f90 + assumed_charlen_arg_1.f90 + assumed_charlen_sharing.f90 + char_length_7.f90 + char_result_13.f90 + deferred_character_36.f90 + mapping_3.f90 + transfer_resolve_1.f90 + + # unimplemented: allocatable component in structure constructor + alloc_comp_constructor_7.f90 + + # unimplemented: gather rhs LEN parameters in assignment to allocatable + allocate_assumed_charlen_4.f90 + allocate_error_5.f90 + char_length_20.f90 + char_length_21.f90 + deferred_character_1.f90 + deferred_character_14.f90 + deferred_character_2.f90 + deferred_character_22.f90 + deferred_character_34.f90 + deferred_character_4.f90 + deferred_character_7.f90 + dependency_50.f90 + dependency_51.f90 + elemental_function_3.f90 + widechar_11.f90 + + # unimplemented: passing dynamically optional argument to elemental procedures + bounds_check_9.f90 + bounds_check_fail_2.f90 + elemental_optional_args_2.f90 + elemental_optional_args_3.f90 + elemental_optional_args_4.f90 + elemental_optional_args_6.f90 + elemental_optional_args_7.f90 + generic_31.f90 + optional_absent_2.f90 + + # unimplemented: BOZ + boz_bge.f90 + + # unimplemented: coarray allocation + associate_37.f90 + + # unimplemented: coarray in procedure interface + coarray_allocate_4.f08 + class_optional_1.f90 + class_optional_2.f90 + coarray_41.f90 + + # unimplemented: coarray reference + coarray_lib_comm_1.f90 + + # unimplemented: CriticalConstruct implementation + coarray_2.f90 + + # unimplemented: intrinsic: this_image + coarray_40.f90 + coarray_stat_2.f90 + random_init_3.f90 + random_init_4.f90 + random_init_5.f90 + random_init_6.f90 + + # unimplemented: intrinsic: co_broadcast + coarray_collectives_17.f90 + + # unimplemented: intrinsic: atan + atan2_1.f90 + + # unimplemented: intrinsic: erfc_scaled + erfc_scaled_1.f90 + + # unimplemented: intrinsic: execute_command_line + execute_command_line_2.f90 + execute_command_line_3.f90 + + # unimplemented: intrinsic: failed_images + coarray_failed_images_1.f08 + + # unimplemented: intrinsic: image_status + coarray_image_status_1.f08 + + # unimplemented: intrinsic: stopped_images + coarray_stopped_images_1.f08 + + # unimplemented: assignment to pointer result of function reference + ptr-func-3.f90 + ptr_func_assign_5.f08 + + # unimplemented: intrinsic: selected_char_kind + selected_char_kind_1.f90 + selected_char_kind_4.f90 + + # unimplemented: intrinsic: min and max for CHARACTER + minmax_char_1.f90 + widechar_intrinsics_9.f90 + zero_length_2.f90 + + # unimplemented: %VAL() intrinsic for arguments + c_by_val_1.f + c_by_val_5.f90 + pointer_check_12.f90 + + # unimplemented: parameterized derived types + dec_type_print_2.f03 + pdt_1.f03 + pdt_10.f03 + pdt_22.f03 + pdt_25.f03 + pdt_7.f03 + + # unimplemented: host associated derived type with length parameters + pdt_31.f03 + + # unimplemented: derived type components with non default lower bounds + structure_constructor_1.f03 + + # unimplemented: asynchronous transfers not implemented in runtime + f2003_inquire_1.f03 + f2003_io_1.f03 + + # unimplemented: support for UNION + dec_init_1.f90 + dec_init_3.f90 + dec_init_4.f90 + dec_structure_22.f90 + dec_union_1.f90 + dec_union_2.f90 + dec_union_3.f90 + dec_union_4.f90 + dec_union_5.f90 + dec_union_6.f90 + + # unimplemented: no math runtime available for '[SYM]' + large_integer_kind_2.f90 + large_real_kind_2.F90 + large_real_kind_3.F90 + large_real_kind_3.F90 + large_real_kind_form_io_1.f90 + norm2_3.f90 + pr96711.f90 +) + +# These tests are skipped because they cannot be compiled. Unlike the +# UnimplementedTests list, they do not fail with a "not yet implemented" +# assertion. The root cause for the failure could very well be one of those, +# but with the specific failure mode that is observed, it is not clear what +# missing feature is causing the compile-failure for these tests. +# If any of these tests use features that will never be supported, they should +# be moved to the UnsupportedTests list. If the cause of the failure of any +# tests in this list is addressed, they should be removed from here. +# +file(GLOB Skipped CONFIGURE_DEPENDS + # -------------------------------------------------------------------------- + # + # These tests are skipped because they trigger internal compiler errors. + # + + # error: Unexpected typeless constant value + actual_array_constructor_1.f90 + actual_array_offset_1.f90 + actual_pointer_function_1.f90 + aliasing_dummy_1.f90 + aliasing_dummy_4.f90 + allocatable_function_10.f90 + allocatable_function_9.f90 + allocatable_scalar_10.f90 + allocatable_scalar_13.f90 + allocatable_scalar_3.f90 + allocatable_scalar_9.f90 + allocate_alloc_opt_6.f90 + allocate_class_3.f90 + allocate_derived_5.f90 + allocate_error_6.f90 + allocate_with_mold_1.f90 + allocate_with_mold_3.f90 + allocate_with_source_15.f03 + allocate_with_source_16.f90 + allocate_with_source_22.f03 + allocate_with_source_23.f03 + allocate_with_source_24.f90 + allocate_with_source_5.f90 + allocate_with_source_6.f90 + allocate_with_source_7.f08 + allocate_with_source_9.f08 + alloc_comp_assign_10.f90 + alloc_comp_assign_11.f90 + alloc_comp_assign_12.f03 + alloc_comp_assign_13.f08 + alloc_comp_assign_14.f08 + alloc_comp_assign_15.f03 + alloc_comp_assign_16.f03 + alloc_comp_assign_1.f90 + alloc_comp_assign_2.f90 + alloc_comp_assign_3.f90 + alloc_comp_assign_4.f90 + alloc_comp_assign_5.f90 + alloc_comp_assign_6.f90 + alloc_comp_assign_7.f90 + alloc_comp_assign_8.f90 + alloc_comp_assign_9.f90 + alloc_comp_auto_array_1.f90 + alloc_comp_auto_array_2.f90 + alloc_comp_basics_1.f90 + alloc_comp_basics_2.f90 + alloc_comp_basics_5.f90 + alloc_comp_bounds_1.f90 + alloc_comp_class_1.f90 + alloc_comp_class_3.f03 + alloc_comp_class_4.f03 + alloc_comp_class_5.f03 + alloc_comp_constructor_1.f90 + alloc_comp_constructor_2.f90 + alloc_comp_constructor_3.f90 + alloc_comp_constructor_4.f90 + alloc_comp_constructor_5.f90 + alloc_comp_constructor_6.f90 + alloc_comp_deep_copy_2.f03 + alloc_comp_deep_copy_3.f03 + alloc_comp_default_init_1.f90 + alloc_comp_default_init_2.f90 + alloc_comp_initializer_1.f90 + alloc_comp_initializer_4.f03 + alloc_comp_misc_1.f90 + alloc_comp_optional_1.f90 + alloc_comp_result_1.f90 + alloc_comp_result_3.f90 + alloc_comp_scalar_1.f90 + alloc_comp_transformational_1.f90 + alloc_deferred_comp_1.f90 + array_constructor_32.f90 + array_constructor_type_14.f03 + array_constructor_type_8.f03 + arrayio_11.f90 + arrayio_derived_1.f90 + array_memcpy_5.f90 + array_reference_2.f90 + assign_func_dtcomp_1.f90 + associate_1.f03 + associate_24.f90 + associate_27.f90 + associate_28.f90 + associate_32.f03 + associate_38.f90 + associate_43.f90 + associate_46.f90 + associate_47.f90 + associate_60.f90 + associate_9.f03 + associated_target_3.f90 + associated_target_6.f03 + associated_target_7.f90 + assumed_rank_21.f90 + bind_c_coms.f90 + bind_c_dts_2.f03 + bind_c_usage_10.f03 + bind_c_usage_16.f03 + bind_c_usage_24.f90 + bind_c_usage_33.f90 + binding_c_table_15_1.f03 + binding_label_tests_16.f03 + binding_label_tests_33.f90 + block_13.f08 + blockdata_11.f90 + bound_1.f90 + bound_5.f90 + bounds_check_17.f90 + bounds_check_5.f90 + bounds_check_8.f90 + c_char_tests_2.f03 + c_char_tests_3.f90 + c_f_pointer_shape_tests_5.f90 + c_f_pointer_tests_4.f90 + c_f_pointer_tests.f90 + c_funloc_tests_3.f03 + c_funloc_tests_4.f03 + c_funloc_tests.f03 + c_funptr_1.f90 + c_funptr_1_mod.f90 + char4-subscript.f90 + character_array_constructor_1.f90 + char_array_structure_constructor.f90 + char_assign_1.f90 + char_length_15.f90 + char_pointer_comp_assign.f90 + char_result_5.f90 + char_result_6.f90 + char_type_len.f90 + c_kind_int128_test2.f03 + c_kind_params.f90 + class_19.f03 + class_25.f03 + class_40.f03 + class_65.f90 + class_67.f90 + class_70.f03 + class_alias.f90 + class_allocate_11.f03 + class_allocate_12.f90 + class_allocate_14.f90 + class_allocate_15.f90 + class_allocate_20.f90 + class_array_16.f90 + class_array_21.f03 + class_array_23.f03 + class_array_7.f03 + class_array_9.f03 + class_assign_4.f90 + class_defined_operator_1.f03 + class_defined_operator_2.f03 + class_dummy_2.f03 + class_result_10.f90 + class_result_1.f03 + class_result_9.f90 + class_to_type_3.f03 + c_loc_test_20.f90 + c_loc_test.f90 + c_loc_tests_2.f03 + coarray_allocate_10.f08 + coarray_allocate_6.f08 + coarray_allocate_7.f08 + coarray_allocate_8.f08 + coarray_allocate_9.f08 + coarray_alloc_comp_1.f08 + coarray_alloc_comp_2.f08 + coarray_alloc_comp_3.f08 + coarray_alloc_comp_6.f08 + coarray_alloc_comp_7.f08 + coarray_alloc_comp_8.f08 + coarray_lib_alloc_4.f90 + coarray_poly_9.f90 + coarray_ptr_comp_1.f08 + coarray_ptr_comp_2.f08 + coarray_send_by_ref_1.f08 + com_block_driver.f90 + constructor_2.f90 + contained_module_proc_1.f90 + c_ptr_tests_10.f03 + c_ptr_tests_14.f90 + c_ptr_tests_19.f90 + c_ptr_tests_7.f03 + c_ptr_tests_8.f03 + c_ptr_tests_9.f03 + c_ptr_tests.f03 + cshift_2.f90 + cshift_nan_1.f90 + c_sizeof_1.f90 + c_sizeof_5.f90 + c_size_t_test.f03 + data_derived_1.f90 + data_stmt_pointer.f90 + dec_init_2.f90 + dec_structure_18.f90 + dec_structure_1.f90 + dec_structure_2.f90 + dec_structure_25.f90 + dec_structure_3.f90 + dec_structure_4.f90 + default_initialization_5.f90 + deferred_character_10.f90 + deferred_character_11.f90 + deferred_character_12.f90 + deferred_character_13.f90 + deferred_character_23.f90 + deferred_character_25.f90 + deferred_character_28.f90 + deferred_character_3.f90 + deferred_character_5.f90 + deferred_character_6.f90 + deferred_type_component_1.f90 + deferred_type_component_2.f90 + deferred_type_component_3.f90 + dependency_22.f90 + dependency_23.f90 + dependency_24.f90 + dependency_39.f90 + dependency_55.f90 + der_array_1.f90 + der_array_io_1.f90 + der_array_io_2.f90 + derived_comp_array_ref_1.f90 + derived_comp_array_ref_2.f90 + derived_comp_array_ref_3.f90 + derived_comp_array_ref_4.f90 + derived_comp_array_ref_7.f90 + derived_constructor_comps_1.f90 + derived_constructor_comps_4.f90 + derived_constructor_comps_5.f90 + derived_constructor_comps_6.f90 + derived_constructor_comps_7.f90 + derived_external_function_1.f90 + derived_init_3.f90 + derived_init_5.f90 + der_ptr_component_2.f90 + dtio_10.f90 + dtio_12.f90 + dtio_14.f90 + dtio_15.f90 + dtio_16.f90 + dtio_17.f90 + dtio_19.f90 + dtio_1.f90 + dtio_24.f90 + dtio_25.f90 + dtio_26.f03 + dtio_27.f90 + dtio_28.f03 + dtio_2.f90 + dtio_30.f03 + dtio_31.f03 + dtio_32.f03 + dtio_33.f90 + dtio_34.f90 + dtio_3.f90 + dtio_4.f90 + dtio_7.f90 + dtio_8.f90 + dtio_9.f90 + dynamic_dispatch_11.f03 + dynamic_dispatch_4.f03 + dynamic_dispatch_5.f03 + dynamic_dispatch_6.f03 + dynamic_dispatch_7.f03 + dynamic_dispatch_8.f03 + dynamic_dispatch_9.f03 + elemental_assignment_1.f90 + elemental_dependency_5.f90 + elemental_dependency_6.f90 + elemental_subroutine_10.f90 + elemental_subroutine_11.f90 + elemental_subroutine_2.f90 + elemental_subroutine_3.f90 + entry_13.f90 + entry_16.f90 + equiv_constraint_4.f90 + extends_4.f03 + finalize_13.f90 + finalize_17.f90 + finalize_25.f90 + finalize_31.f90 + finalize_33.f90 + finalize_36.f90 + finalize_38.f90 + finalize_38a.f90 + finalize_50.f90 + finalize_52.f90 + fmt_nonchar_2.f90 + forall_1.f90 + func_assign_3.f90 + func_derived_1.f90 + func_derived_2.f90 + func_derived_3.f90 + func_derived_4.f90 + func_result_6.f90 + function_kinds_1.f90 + generic_15.f90 + generic_23.f03 + implied_do_io_1.f90 + import4.f90 + import.f90 + init_flag_15.f03 + inline_matmul_1.f90 + inline_matmul_9.f90 + inquiry_type_ref_5.f90 + intent_optimize_10.f90 + intent_out_14.f90 + interface_assignment_2.f90 + internal_pack_13.f90 + internal_pack_14.f90 + internal_pack_1.f90 + internal_pack_8.f90 + intrinsic_pack_1.f90 + intrinsic_spread_1.f90 + intrinsic_unpack_1.f90 + iso_c_binding_rename_2.f03 + ISO_Fortran_binding_10.f90 + ISO_Fortran_binding_11.f90 + ISO_Fortran_binding_12.f90 + ISO_Fortran_binding_18.f90 + ISO_Fortran_binding_5.f90 + ISO_Fortran_binding_7.f90 + ISO_Fortran_binding_8.f90 + iso_fortran_binding_uint8_array.f90 + logical_temp_io.f90 + logical_temp_io_kind8.f90 + module_procedure_6.f90 + module_read_2.f90 + move_alloc_15.f90 + move_alloc_16.f90 + move_alloc_4.f90 + multiple_allocation_2.f90 + mvbits_7.f90 + mvbits_8.f90 + namelist_14.f90 + namelist_52.f90 + namelist_54.f90 + namelist_55.f90 + namelist_58.f90 + namelist_60.f90 + namelist_66.f90 + namelist_69.f90 + namelist_70.f90 + namelist_71.f90 + namelist_77.f90 + namelist_79.f90 + namelist_82.f90 + namelist_85.f90 + nested_allocatables_1.f90 + nested_modules_3.f90 + null_9.f90 + nullify_3.f90 + optional_class_1.f90 + overload_1.f90 + parameter_array_init_8.f90 + pdt_11.f03 + pdt_12.f03 + pdt_13.f03 + pdt_14.f03 + pdt_27.f03 + pdt_28.f03 + pointer_array_11.f90 + pointer_array_1.f90 + pointer_array_3.f90 + pointer_array_4.f90 + pointer_array_6.f90 + pointer_array_7.f90 + pointer_array_component_1.f90 + pointer_assign_14.f90 + pointer_assign_15.f90 + pointer_check_11.f90 + pointer_init_1.f90 + pointer_init_8.f90 + pointer_remapping_10.f90 + PR100132.f90 + PR100136.f90 + PR100911.f90 + pr100950.f90 + pr105205.f90 + pr106731.f90 + pr106918.f90 + pr107872.f90 + pr16938.f90 + pr17612.f90 + pr18392.f90 + pr19928-2.f90 + pr32627.f03 + pr35983.f90 + pr43808.f90 + pr43866.f90 + pr47008.f03 + pr55086_aliasing_dummy_4_tfat.f90 + pr62125.f90 + pr64230.f90 + pr65504.f90 + pr69955.f90 + pr71764.f90 + pr84155.f90 + pr84523.f90 + pr86322_3.f90 + pr88611.f90 + pr92050.f90 + pr93685_1.f90 + pr99602b.f90 + print_c_kinds.f90 + proc_decl_17.f90 + proc_decl_2.f90 + proc_ptr_comp_12.f90 + proc_ptr_comp_15.f90 + proc_ptr_comp_16.f90 + proc_ptr_comp_17.f90 + proc_ptr_comp_23.f90 + proc_ptr_comp_47.f90 + proc_ptr_comp_pass_1.f90 + proc_ptr_comp_pass_5.f90 + ptr_func_assign_1.f08 + ptr_func_assign_3.f08 + read_dir.f90 + realloc_on_assign_16.f90 + realloc_on_assign_17.f90 + realloc_on_assign_23.f90 + realloc_on_assign_28.f90 + realloc_on_assign_2.f03 + realloc_on_assign_32.f90 + realloc_on_assign_3.f03 + realloc_on_assign_9.f90 + recursive_alloc_comp_1.f08 + recursive_alloc_comp_2.f08 + recursive_alloc_comp_3.f08 + recursive_alloc_comp_4.f08 + recursive_check_16.f90 + repack_arrays_1.f90 + reshape.f90 + reshape_transpose_1.f90 + reshape_zerosize_3.f90 + same_type_as_3.f03 + select_type_15.f03 + select_type_36.f03 + select_type_43.f90 + simplify_cshift_1.f90 + sizeof.f90 + spread_scalar_source.f90 + spread_simplify_1.f90 + structure_constructor_14.f90 + structure_constructor_2.f03 + submodule_18.f08 + submodule_32.f08 + submodule_6.f08 + submodule_7.f08 + subref_array_pointer_1.f90 + subref_array_pointer_2.f90 + subref_array_pointer_4.f90 + substr_alloc_string_comp_1.f90 + transfer_assumed_size_1.f90 + transfer_simplify_10.f90 + transfer_simplify_1.f90 + transfer_simplify_2.f90 + trim_optimize_5.f90 + typebound_assignment_5a.f03 + typebound_assignment_6.f03 + typebound_assignment_7.f90 + typebound_call_10.f03 + typebound_call_13.f03 + typebound_call_17.f03 + typebound_call_18.f03 + typebound_call_19.f03 + typebound_call_1.f03 + typebound_call_20.f03 + typebound_call_2.f03 + typebound_call_3.f03 + typebound_call_6.f03 + typebound_generic_3.f03 + typebound_generic_4.f03 + typebound_generic_5.f03 + typebound_generic_6.f03 + typebound_generic_9.f03 + typebound_operator_12.f03 + typebound_operator_13.f03 + typebound_operator_20.f90 + typebound_operator_21.f03 + typebound_operator_3.f03 + typebound_operator_6.f03 + typebound_operator_7.f03 + typebound_operator_8.f03 + typebound_operator_9.f03 + typebound_proc_20.f90 + typebound_proc_23.f90 + typebound_proc_27.f03 + typebound_proc_35.f90 + typebound_proc_36.f90 + type_to_class_4.f03 + unlimited_polymorphic_18.f90 + unlimited_polymorphic_19.f90 + unlimited_polymorphic_1.f03 + unlimited_polymorphic_23.f90 + unlimited_polymorphic_25.f90 + unlimited_polymorphic_26.f90 + unlimited_polymorphic_29.f90 + use_24.f90 + use_27.f90 + used_dummy_types_1.f90 + value_1.f90 + value_tests_f03.f90 + where_2.f90 + whole_file_13.f90 + whole_file_14.f90 + winapi.f90 + zero_array_components_1.f90 + + # error: 'fir.convert' op invalid type conversion + achar_4.f90 + c_char_tests_4.f90 + c_char_tests_5.f90 + widechar_6.f90 + widechar_intrinsics_6.f90 + widechar_intrinsics_7.f90 + widechar_select_1.f90 + + # error: a function must have a type + proc_decl_9.f90 + + # error: not a constant derived type expression + allocate_with_source_10.f08 + allocate_with_source_11.f08 + arrayio_12.f90 + associate_25.f90 + associated_4.f90 + associated_target_5.f03 + automatic_default_init_1.f90 + char_component_initializer_1.f90 + char_component_initializer_2.f90 + char_length_8.f90 + charlen_15.f90 + charlen_16.f90 + class_9.f03 + class_allocate_10.f03 + class_allocate_7.f03 + class_allocate_8.f03 + class_allocate_9.f03 + class_array_4.f03 + class_to_type_2.f90 + coarray_42.f90 + constructor_3.f90 + dec_structure_6.f90 + default_initialization_3.f90 + default_initialization_4.f90 + deferred_character_26.f90 + defined_assignment_1.f90 + defined_assignment_10.f90 + defined_assignment_11.f90 + defined_assignment_2.f90 + defined_assignment_3.f90 + defined_assignment_4.f90 + defined_assignment_5.f90 + defined_assignment_9.f90 + dependency_25.f90 + der_array_io_3.f90 + derived_init_1.f90 + derived_init_2.f90 + derived_init_4.f90 + derived_pointer_recursion_2.f90 + dtio_22.f90 + dynamic_dispatch_1.f03 + dynamic_dispatch_12.f90 + dynamic_dispatch_2.f03 + dynamic_dispatch_3.f03 + extends_1.f03 + extends_16.f90 + extends_3.f03 + finalize_15.f90 + finalize_29.f08 + finalize_39.f90 + finalize_40.f90 + finalize_41.f90 + finalize_42.f90 + finalize_43.f90 + finalize_44.f90 + finalize_45.f90 + finalize_46.f90 + finalize_47.f90 + finalize_48.f90 + forall_19.f90 + init_flag_10.f90 + initialization_11.f90 + initialization_19.f90 + initialization_27.f90 + inquiry_type_ref_1.f08 + intent_out_13.f90 + intent_out_2.f90 + intent_out_5.f90 + interface_assignment_1.f90 + internal_pack_10.f90 + internal_pack_6a.f90 + intrinsic_pack_5.f90 + intrinsic_pack_6.f90 + move_alloc_10.f90 + move_alloc_6.f90 + namelist_13.f90 + namelist_15.f90 + namelist_40.f90 + namelist_47.f90 + namelist_64.f90 + namelist_78.f90 + namelist_96.f90 + no-automatic.f90 + optional_assumed_charlen_2.f90 + pointer_array_component_2.f90 + pointer_assign_10.f90 + pointer_assign_11.f90 + pointer_assign_8.f90 + pointer_assign_9.f90 + pointer_init_3.f90 + pr19926.f90 + pr51434.f90 + pr68078.f90 + pr69739.f90 + pr78290.f90 + pr83864.f90 + pr85786.f90 + result_default_init_1.f90 + structure_constructor_5.f03 + submodule_1.f08 + submodule_2.f08 + temporary_3.f90 + transfer_class_2.f90 + typebound_call_32.f90 + typebound_operator_15.f90 + + # error: unemittable constant value + namelist_utf8.f90 + + # error: cannot be converted to LLVM IR: missing + # `LLVMTranslationDialectInterface` registration for dialect for op: func.func + leadz_trailz_1.f90 + leadz_trailz_2.f90 + + # error: failed to legalize operation 'math.ctlz' that was explicitly marked + # illegal + leadz_trailz_3.f90 + + # -------------------------------------------------------------------------- + # + # These tests are skipped because they result in a compile error. This may + # be the result of them exercising unsupported extensions that are not + # supported in flang or some other reason. If there are multiple errors + # in a single file, each unique error message will be provided. + + # error: Entity in ALLOCATE statement must have the ALLOCATABLE or POINTER + # attribute + ISO_Fortran_binding_15.f90 + + # error: Left-hand side of assignment may not be polymorphic unless + # assignment is to an entire allocatable + PR100040.f90 + PR100103.f90 + + # error: The left-hand side of a pointer assignment is not definable + PR100094.f90 + associate_42.f90 + + # error: Assumed-rank array cannot be forwarded to '[var]=' argument + PR100906.f90 + PR100914.f90 + assumed_rank_10.f90 + assumed_rank_24.f90 + assumed_rank_9.f90 + associated_assumed_rank.f90 + assumed_rank_16.f90 + assumed_rank_8.f90 + + # error: Pointer has rank 0 but target has rank [n] + PR94331.f90 + PR94327.f90 + assumed_rank_1.f90 + + # error: Actual argument variable length '1' does not match the expected + # length '77' + PR95214.f90 + + # error: Dimension 1 of left operand has extent [m], but right operand has + # extent [n] + PR94289.f90 + assumed_rank_2.f90 + assumed_rank_22.f90 + assumed_rank_bounds_2.f90 + assumed_rank_bounds_3.f90 + assumed_rank_17.f90 + assumed_rank_bounds_1.f90 + + # error: DIM=3 dimension is out of range for rank-1 array + assumed_rank_3.f90 + assumed_rank_7.f90 + + # error: Subscript [m] is less than lower bound [n] for dimension [d] of + # array + bounds_check_11.f90 + bounds_check_fail_1.f90 + + # error: Assumed-size polymorphic array may not be associated with a + # monomorphic dummy argument + class_dummy_7.f90 + + # error: '[var]' is an external procedure without the EXTERNAL attribute in + # a scope with IMPLICIT NONE(EXTERNAL) + assumed_type_13.f90 + bind-c-contiguous-3.f90 + bind-c-intent-out.f90 + + # error: '[SYM]' may not appear in NULLIFY because '[SYM2]' is an INTENT(IN) + # dummy argument + pointer_intent_1.f90 + + # error: Assumed type argument requires an explicit interface + assumed_type_2a.f90 + + # error: No intrinsic or user-defined ASSIGNMENT(=) matches operand types + # 'TYPE 1' and 'TYPE 2' + dec-comparison-complex_1.f90 + dec-comparison-complex_2.f90 + dec-comparison-int_1.f90 + dec-comparison-int_2.f90 + dec-comparison-real_1.f90 + dec-comparison-real_2.f90 + dec_char_conversion_in_assignment_1.f90 + dec_char_conversion_in_assignment_2.f90 + dec_char_conversion_in_assignment_3.f90 + dec_char_conversion_in_assignment_5.f90 + dec_char_conversion_in_assignment_6.f90 + dec_char_conversion_in_assignment_7.f90 + hollerith2.f90 + hollerith4.f90 + hollerith6.f90 + pdt_23.f03 + + # error: Operands of .AND. must be LOGICAL; have 'TYPE 1' and 'TYPE 2' + dec_bitwise_ops_1.f90 + dec_bitwise_ops_2.f90 + + # error: A BIND(C) object must have an interoperable type + bind-c-contiguous-1.f90 + bind-c-contiguous-4.f90 + bind-c-contiguous-5.f90 + bind_c_char_10.f90 + char4_decl-2.f90 + + # error: A dim= argument is required for 'size' when the array is + # assumed-size + class_dummy_6.f90 + + # error: No explicit type declared for '[sym]' + PR49268.f90 + boz_complex_3.f90 + char_result_19.f90 + chmod_1.f90 + chmod_2.f90 + chmod_3.f90 + coarray_16.f90 + cray_pointers_7.f90 + dec_math.f90 + dec_math_5.f90 + fmt_en.f90 + fmt_en_rd.f90 + fmt_en_rn.f90 + fmt_en_ru.f90 + fmt_en_rz.f90 + fmt_f0_2.f90 + fmt_f0_3.f90 + fmt_g0_6.f08 + fmt_g0_7.f08 + fmt_pf.f90 + interface_12.f90 + result_in_spec_1.f90 + round_4.f90 + unlimited_polymorphic_13.f90 + + # error: Shape of initialized object 'foo' must be constant + pdt_26.f03 + + # error: Kind type parameters of allocatable object must be the same as the + # corresponding ones of SOURCE or MOLD expression + pdt_3.f03 + + # error: [sym] is not a variable + cray_pointers_8.f90 + + # error: Typeless (BOZ) not allowed for 'a=' argument + boz_float_3.f90 + + # error: Actual argument for 'i=' has bad type 'LOGICAL(1)' + and_or_xor.f90 + + # error: Argument of ALLOCATED() must be an ALLOCATABLE object or component + select_rank_1.f90 + + # error: 'coarray=' argument must have corank > 0 for intrinsic 'lcobound' + bound_simplification_4.f90 + bound_simplification_5.f90 + + # error: Coarray argument requires an explicit interface + coarray_15.f90 + + # error: 'mask=' argument has unacceptable rank 0 + coarray_13.f90 + + # error: 'a' has corank 0, but coindexed reference has 1 cosubscripts + coindexed_1.f90 + + # error: 'temp_node_t' is PRIVATE in 'temp_node' + constructor_6.f90 + + # error: Invalid CONVERT value 'swap' + convert_2.f90 + + # error: Type of Cray pointee 'dpte1' is a non-sequence derived type + cray_pointers_2.f90 + + # error: DATA statement value could not be converted to the type '[TYPE]' + dec_char_conversion_in_data_1.f90 + dec_char_conversion_in_data_2.f90 + dec_char_conversion_in_data_4.f90 + dec_char_conversion_in_data_5.f90 + dec_char_conversion_in_data_6.f90 + hollerith.f90 + + # error: Duplicate UNIT specifier + dec_io_5.f90 + dec_io_6.f90 + + # error: cannot process subprogram that was already processed + binding_label_tests_12.f03 + + # error: Value of named constant cannot be computed as a constant value + array_initializer_1.f90 + pr83874.f90 + + # error: In an elemental procedure reference with at least one array argument, + # actual argument that corresponds to an INTENT(OUT) or INTENT(INOUT) dummy + # argument must be an array + impure_1.f08 + + # error: Invalid STATUS value + iomsg_1.f90 + iostat_2.f90 + pr20163-2.f + + # error: '[SYM]' was not declared a separate module procedure + class_assign_1.f08 + submodule_31.f08 + + # error: No operator .XOR. defined for LOGICAL(4) and LOGICAL(4) + dec_logical_xor_1.f90 + + # error: Value in structure constructor of type 'education' is incompatible + # with component + extends_2.f03 + + # error: If a POINTER or ALLOCATABLE dummy or actual argument is polymorphic, + # both must be so + finalize_12.f90 + + # error: Must be a scalar value, but is a rank-1 array + impl_do_var_data.f90 + + # error: Unlimited format item list must contain a data edit descriptor + fmt_error_11.f03 + + # error: Expected '[FMT]' edit descriptor '.[SOMETHING]' value + fmt_missing_period.f + fmt_missing_period_2.f + + # error: Positive scale factor k (from kP) and width d in a 'E' edit + # descriptor must satisfy 'k < d+2' + fmt_zero_digits.f90 + + # error: '[SYM]' is not a known intrinsic procedure + gamma_1.f90 + specifics_1.f90 + + # error: Keyword may not appear in a reference to a procedure with an implicit + # interface + getenv_1.f90 + + # error: Cannot use-associate 'x'; it is already declared in this scope + iso_fortran_env_3.f90 + + # error: Must be a constant value + matmul_17.f90 + matmul_8.f03 + pr67140.f90 + pr89077.f90 + substr_simplify.f90 + transfer_simplify_12.f90 + zero_sized_9.f90 + + # error: Subscript 3 is greater than upper bound 2 for dimension 1 of array + module_procedure_4.f90 + + # error: '[SYM]' is not an object that can appear in an expression + namelist_print_1.f + + # error: '[SYM]' is already declared in this scoping unit + namelist_use.f90 + + # error: Actual argument type '[TYPE1]' is not compatible with dummy argument + # type '[TYPE2]' + no_arg_check_2a.f90 + pdt_2.f03 + + # error: '[SYM]' not found in module 'iso_fortran_env' + overload_3.f90 + pr66311.f90 + proc_ptr_comp_6.f90 + proc_ptr_comp_pass_2.f90 + quad_2.f90 + quad_3.f90 + team_change_1.f90 + team_end_1.f90 + team_form_1.f90 + team_number_1.f90 + unlimited_polymorphic_31.f03 + + # error: VOLATILE attribute was already specified + volatile10.f90 + + # error: 'mask=' argument has unacceptable rank 0 + pdt_20.f03 + + # error: literal is too large + pr92629.f90 + + # error: In assignment to procedure pointer 'funct', the target is not a + # procedure or procedure pointer + proc_ptr_47.f90 + + # error: '[SYM]' may not be a procedure as it is in a COMMON block + proc_ptr_common_1.f90 + + # error: Procedure pointer may not be ELEMENTAL + proc_ptr_comp_45.f90 + + # error: Procedure pointer associated with result of reference to function + # that is an incompatible procedure pointer + proc_ptr_result_1.f90 + + # error: Actual argument associated with procedure pointer dummy argument + # must be a POINTER unless INTENT(IN) + proc_ptr_result_6.f90 + + # error: Must have '[TYPE1]' type, but is '[TYPE2]' + real_index_1.f90 + + # error: error: Invalid CONVERT value + record_marker_1.f90 + record_marker_3.f90 + unf_io_convert_1.f90 + unf_io_convert_2.f90 + unf_io_convert_3.f90 + + # error: Implicit declaration of function has a different result type than in + # previous declaration + recursive_check_14.f90 + + # error: Result of pure function may not have an impure FINAL subroutine + finalize_51.f90 + + # -------------------------------------------------------------------------- + # + # These tests are skipped for a variety of reasons that don't fit well in + # any of the previous categories + + # The file char_result_mod_19.f90 has the { dg-do run } annotation, but it is + # not actually the main test file. That would be char_result_19.f90 which is + # listed as a dependency of char_result_mod_19.f90. This seems to be + # backwards. + char_result_mod_19.f90 + + # The test calls the subroutine should_not_fail(). The intention seems to be + # for the call to should_not_fail() to be dead-code eliminated. It is guarded + # by a conditional with a call to selected_real_kind() that should evaluate + # to false at compile-time. This is not being eliminated resulting in an + # "undefined symbol" error at link time. + # + selected_real_kind_2.f90 + + # For some reason, when building these tests, LLVM-IR is generated instead of + # of an object file. + save_6.f90 + shape_9.f90 + + # These tests seem to hang at runtime. Not sure if this indicates a problem + # with flang or with the tests themselves. + # + # FIXME: This should be checked and this comment should either be updated to + # reflect what the actual problem is with the tests or the tests should be + # removed from this list. + namelist_42.f90 + namelist_43.f90 + + # -------------------------------------------------------------------------- + # + # These tests are skipped because flang cannot parse these files. This could + # be because of the use of non-standard syntax, but they will need to be + # checked to be sure. + # + auto_in_equiv_1.f90 + auto_in_equiv_2.f90 + automatic_1.f90 + dec-comparison-character_1.f90 + dec-comparison-character_2.f90 + dec_exp_1.f90 + dec_format_empty_item_1.f + dec_format_empty_item_2.f + dec_io_1.f90 + dec_parameter_1.f + dec_parameter_2.f90 + dec_static_1.f90 + dec_static_2.f90 + dec_structure_10.f90 + dec_structure_5.f90 + dec_structure_7.f90 + fmt_error_10.f + fmt_error_9.f + fmt_t_9.f + substr_9.f90 + + # -------------------------------------------------------------------------- + # + # These tests are skipped because they cause flang to crash. + + # Assertion `ty.isa()' failed + c_assoc.f90 + c_f_pointer_complex.f03 + c_f_pointer_logical.f03 + c_f_pointer_shape_tests_2.f03 + c_f_pointer_shape_tests_4.f03 + deferred_character_8.f90 + equiv_7.f90 + iso_c_binding_rename_1.f03 + test_only_clause.f90 +) + +# These tests fail at runtime when they should pass. are likely a result of +# unimplemented features in the runtime, but they could also be bugs. If any +# will never pass with flang (if they use unsupported extensions for instance), +# they should be added to the Unsupported list. These are not enabled by default +# to ensure that the default configuration of the test suite does not fail. +# Tests should be removed from this list when the cause of their failure is +# addressed. +file(GLOB Failing CONFIGURE_DEPENDS + Wall.f90 + Wno-all.f90 + abort_shouldfail.f90 + achar_6.F90 + advance_5.f90 + advance_6.f90 + aliasing_dummy_5.f90 + allocate_alloc_opt_15.f90 + allocate_alloc_opt_3.f90 + allocate_deferred_char_scalar_1.f03 + allocate_zerosize_3.f + arrayio_1.f90 + arrayio_3.f90 + arrayio_5.f90 + arrayio_6.f90 + assign_2.f90 + auto_save_2.f90 + backslash_2.f90 + backslash_3.f + backspace_2.f + backspace_6.f + bessel_7.f90 + bounds_check_19.f90 + boz_15.f90 + c_char_tests.f03 + char4_iunit_1.f03 + char4_iunit_2.f03 + check_bits_1.f90 + check_bits_2.f90 + continuation_12.f90 + continuation_13.f90 + continuation_1.f90 + cr_lf.f90 + cray_pointers_10.f90 + cray_pointers_5.f90 + cshift_bounds_3.f90 + cshift_bounds_4.f90 + cshift_large_1.f90 + data_char_1.f90 + data_char_3.f90 + deallocate_alloc_opt_3.f90 + deallocate_stat_2.f90 + deallocate_stat.f90 + dependency_45.f90 + dim_sum_1.f90 + dim_sum_2.f90 + dim_sum_3.f90 + direct_io_7.f90 + do_check_1.f90 + dollar_edit_descriptor_4.f + elemental_dependency_1.f90 + endfile_3.f90 + eoshift_bounds_1.f90 + eoshift_large_1.f90 + error_format.f90 + error_stop_1.f08 + f2003_io_5.f03 + findloc_6.f90 + fmt_error_4.f90 + fmt_error_5.f90 + fmt_f_default_field_width_1.f90 + fmt_f_default_field_width_2.f90 + fmt_g0_1.f08 + fmt_g_default_field_width_1.f90 + fmt_g_default_field_width_2.f90 + fmt_g.f + fmt_i_default_field_width_1.f90 + fmt_i_default_field_width_2.f90 + fmt_l.f90 + fmt_zero_width.f90 + fold_nearest.f90 + forall_12.f90 + goto_2.f90 + hollerith8.f90 + init_flag_1.f90 + init_flag_2.f90 + init_flag_3.f90 + init_flag_4.f90 + init_flag_5.f90 + init_flag_6.f90 + init_flag_7.f90 + init_flag_9.f90 + inline_matmul_15.f90 + inquire_13.f90 + inquire_15.f90 + inquire_5.f90 + inquire_9.f90 + inquire_internal.f90 + inquire_recl_f2018.f90 + inquire_size.f90 + integer_exponentiation_2.f90 + internal_dummy_2.f08 + internal_pack_3.f90 + internal_write_1.f90 + intrinsic_std_4.f90 + io_err_1.f90 + io_real_boz_3.f90 + io_real_boz.f90 + iostat_4.f90 + iostat_5.f90 + is_contiguous_3.f90 + large_real_kind_1.f90 + large_unit_1.f90 + list_directed_large.f90 + list_read_11.f90 + list_read_4.f90 + literal_character_constant_1_z.F + masklr_2.F90 + matmul_5.f90 + matmul_bounds_11.f90 + matmul_bounds_13.f90 + matmul_bounds_15.f + matmul_bounds_16.f + matmul_bounds_7.f90 + matmul_bounds_9.f90 + maxloc_2.f90 + maxloc_bounds_3.f90 + maxloc_bounds_6.f90 + maxloc_string_1.f90 + maxlocval_2.f90 + maxlocval_4.f90 + merge_bits_2.F90 + minloc_1.f90 + minlocval_1.f90 + minlocval_4.f90 + minmaxloc_10.f90 + minmaxloc_1.f90 + minmaxloc_3.f90 + minval_char_1.f90 + minval_char_3.f90 + minval_parameter_1.f90 + missing_optional_dummy_6.f90 + mod_large_1.f90 + mod_sign0_1.f90 + module_nan.f90 + multiple_allocation_1.f90 + multiple_allocation_3.f90 + mvbits_4.f90 + namelist_18.f90 + namelist_19.f90 + namelist_21.f90 + namelist_22.f90 + namelist_24.f90 + namelist_37.f90 + namelist_38.f90 + namelist_41.f90 + namelist_51.f90 + namelist_56.f90 + namelist_57.f90 + namelist_61.f90 + namelist_65.f90 + namelist_72.f + namelist_73.f90 + namelist_80.f90 + namelist_81.f90 + namelist_84.f90 + namelist_87.f90 + namelist_89.f90 + namelist_97.f90 + namelist_char_only.f90 + nan_2.f90 + nearest_1.f90 + nearest_3.f90 + negative_unit.f + negative_unit_int8.f + no_range_check_1.f90 + norm2_1.f90 + nosigned_zero_2.f90 + open_access_append_2.f90 + open_errors_2.f90 + open_errors_3.f90 + open_negative_unit_1.f90 + open_new_segv.f90 + open_status_2.f90 + pad_source_3.f + pad_source_4.f + pad_source_5.f + pointer_check_6.f90 + pr12884.f + pr17285.f90 + pr17286.f90 + pr17706.f90 + pr18210.f90 + pr19657.f + pr47757-3.f90 + pr47878.f90 + pr50069_1.f90 + pr59700.f90 + pr71523_2.f90 + pr96436_3.f90 + pr96436_4.f90 + pr96436_5.f90 + promotion_3.f90 + promotion_4.f90 + promotion.f90 + random_3.f90 + random_5.f90 + random_init_2.f90 + read_5.f90 + read_bang4.f90 + read_bang.f90 + read_comma.f + read_eof_3.f90 + read_eof_7.f90 + read_eof_all.f90 + read_legacy_comma.f90 + real4-10-real8-10.f90 + real4-10-real8-16.f90 + real4-10-real8-4.f90 + real4-10.f90 + real4-16-real8-10.f90 + real4-16-real8-16.f90 + real4-16-real8-4.f90 + real4-16.f90 + real4-8-real8-10.f90 + real4-8-real8-16.f90 + real4-8-real8-4.f90 + real4-8.f90 + real8-10.f90 + real8-16.f90 + real8-4.f90 + real_const_3.f90 + realloc_on_assign_11.f90 + recursive_check_7.f90 + repeat_1.f90 + reshape_order_1.f90 + reshape_order_2.f90 + reshape_order_3.f90 + reshape_order_4.f90 + round_3.f08 + selected_kind_1.f90 + short_circuiting_3.f90 + stop_shouldfail.f90 + streamio_11.f90 + streamio_13.f90 + streamio_17.f90 + streamio_4.f90 + system_clock_3.f08 + unf_io_convert_4.f90 + unf_read_corrupted_1.f90 + unf_short_record_1.f90 + unformatted_subrecord_1.f90 + unpack_bounds_2.f90 + unpack_bounds_3.f90 + utf8_1.f03 + utf8_2.f03 + widechar_5.f90 + widechar_8.f90 + widechar_IO_4.f90 + widechar_intrinsics_4.f90 + widechar_intrinsics_5.f90 + widechar_intrinsics_8.f90 + write_check.f90 + zero_sized_1.f90 + + # These tests fail at runtime on AArch64 (but pass on x86). Disable them + # anyway so the test-suite passes by default on AArch64. + entry_23.f + findloc_8.f90 +) + +list(APPEND UnsupportedTests "${Unsupported}") +list(APPEND UnimplementedTests "${Unimplemented}") +list(APPEND SkippedTests "${Skipped}") +list(APPEND FailingTests "${Failing}") + +# add_tests will find all files with known Fortran extensions, pick out the ones +# that correspond to the "main" file of the test and filter out the tests that +# are in TestsToSkip. +add_tests("${UnsupportedTests}" "${UnimplementedTests}" "${SkippedTests}" "${FailingTests}") + +add_subdirectory(analyzer) +add_subdirectory(asan) +add_subdirectory(c-interop) +add_subdirectory(coarray) +add_subdirectory(debug) +add_subdirectory(g77) +add_subdirectory(goacc) +add_subdirectory(goacc-gomp) +add_subdirectory(gomp) +add_subdirectory(graphite) +add_subdirectory(guality) +add_subdirectory(ieee) +add_subdirectory(prof) +add_subdirectory(lto) +add_subdirectory(ubsan) +add_subdirectory(vect) + +file(COPY lit.local.cfg DESTINATION "${CMAKE_CURRENT_BINARY_DIR}") diff --git a/Fortran/gfortran/regression/analyzer/CMakeLists.txt b/Fortran/gfortran/regression/analyzer/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/Fortran/gfortran/regression/analyzer/CMakeLists.txt @@ -0,0 +1,10 @@ +#===------------------------------------------------------------------------===# +# +# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +# See https://llvm.org/LICENSE.txt for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +# +#===------------------------------------------------------------------------===# + +# There are currently no tests in this directory to be disabled for any reason. +add_tests("" "" "" "") diff --git a/Fortran/gfortran/regression/asan/CMakeLists.txt b/Fortran/gfortran/regression/asan/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/Fortran/gfortran/regression/asan/CMakeLists.txt @@ -0,0 +1,20 @@ +#===------------------------------------------------------------------------===# +# +# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +# See https://llvm.org/LICENSE.txt for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +# +#===------------------------------------------------------------------------===# + +# These tests trigger internal compiler errors. +file(GLOB Skipped CONFIGURE_DEPENDS + # error: unexpected typeless constant value + pointer_assign_16.f90 +) + +list(APPEND UnsupportedTests "") +list(APPEND UnimplementedTests "") +list(APPEND SkippedTests "${Skipped}") +list(APPEND FailingTests "") + +add_tests("${UnsupportedTests}" "${UnimplementedTests}" "${SkippedTests}" "${FailingTests}") diff --git a/Fortran/gfortran/regression/c-interop/CMakeLists.txt b/Fortran/gfortran/regression/c-interop/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/Fortran/gfortran/regression/c-interop/CMakeLists.txt @@ -0,0 +1,131 @@ +#===------------------------------------------------------------------------===# +# +# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +# See https://llvm.org/LICENSE.txt for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +# +#===------------------------------------------------------------------------===# + +# These tests trigger "not yet implemented" assertions in flang. +file(GLOB Unimplemented CONFIGURE_DEPENDS + # unimplemented: assumed rank in procedure interface + argument-association-assumed-rank-1.f90 + argument-association-assumed-rank-2.f90 + argument-association-assumed-rank-3.f90 + argument-association-assumed-rank-4.f90 + argument-association-assumed-rank-5.f90 + argument-association-assumed-rank-6.f90 + argument-association-assumed-rank-7.f90 + argument-association-assumed-rank-8.f90 + cf-out-descriptor-6.f90 + contiguous-1.f90 + contiguous-2.f90 + contiguous-3.f90 + fc-descriptor-6.f90 + fc-out-descriptor-6.f90 + note-5-3.f90 + note-5-4.f90 + rank.f90 + shape-bindc.f90 + shape.f90 + size-bindc.f90 + size.f90 + ubound-bindc.f90 + ubound.f90 + + # unimplemented: BIND(C) internal procedures + deferred-character-2.f90 + fc-out-descriptor-5.f90 + ff-descriptor-5.f90 + ff-descriptor-6.f90 + ff-descriptor-7.f90 + pr103390-1.f90 + pr103390-2.f90 + pr103390-3.f90 + pr103390-4.f90 + pr103390-5.f90 + pr103390-6.f90 + pr103390-7.f90 + pr103390-8.f90 + pr103390-9.f90 +) + +# These tests are skipped because they trigger internal compiler errors. +file(GLOB Skipped CONFIGURE_DEPENDS + # error: Unexpected typeless constant value + allocatable-dummy.f90 + allocate-errors.f90 + allocate.f90 + cf-descriptor-1.f90 + cf-descriptor-2.f90 + cf-descriptor-3.f90 + cf-descriptor-4.f90 + cf-descriptor-5.f90 + cf-descriptor-6.f90 + cf-descriptor-7.f90 + cf-descriptor-8.f90 + cf-out-descriptor-1.f90 + cf-out-descriptor-2.f90 + cf-out-descriptor-3.f90 + cf-out-descriptor-4.f90 + cf-out-descriptor-5.f90 + establish-errors.f90 + establish.f90 + fc-descriptor-1.f90 + fc-descriptor-2.f90 + fc-descriptor-3.f90 + fc-descriptor-4.f90 + fc-descriptor-5.f90 + fc-descriptor-8.f90 + fc-descriptor-9.f90 + fc-out-descriptor-1.f90 + fc-out-descriptor-2.f90 + fc-out-descriptor-3.f90 + fc-out-descriptor-4.f90 + fc-out-descriptor-7.f90 + ff-descriptor-1.f90 + ff-descriptor-2.f90 + ff-descriptor-3.f90 + ff-descriptor-4.f90 + optional.f90 + rank-class.f90 + section-2.f90 + section-2p.f90 + section-3.f90 + section-3p.f90 + section-4.f90 + section-errors.f90 + select-errors.f90 + select.f90 + setpointer-errors.f90 + setpointer.f90 + shape-poly.f90 + size-poly.f90 + typecodes-array-basic.f90 + typecodes-array-float128.f90 + typecodes-array-int128.f90 + typecodes-array-longdouble.f90 + typecodes-sanity.f90 + typecodes-scalar-basic.f90 + typecodes-scalar-float128.f90 + typecodes-scalar-int128.f90 + typecodes-scalar-longdouble.f90 + ubound-poly.f90 + + # error: '[SYM]' is an external procedure without the EXTERNAL attribute in a + # scope with IMPLICIT NONE(EXTERNAL) + fc-descriptor-7.f90 + + # error: A BIND(C) object must have an interoperable type + typecodes-array-char.f90 + + # error: No explicit type declared for '[SYM]' + section-1.f90 + section-1p.f90) + +list(APPEND UnsupportedTests "") +list(APPEND UnimplementedTests "${Unimplemented}") +list(APPEND SkippedTests "${Skipped}") +list(APPEND FailingTests "") + +add_tests("${UnsupportedTests}" "${UnimplementedTests}" "${SkippedTests}" "${FailingTests}") diff --git a/Fortran/gfortran/regression/coarray/CMakeLists.txt b/Fortran/gfortran/regression/coarray/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/Fortran/gfortran/regression/coarray/CMakeLists.txt @@ -0,0 +1,135 @@ +#===------------------------------------------------------------------------===# +# +# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +# See https://llvm.org/LICENSE.txt for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +# +#===------------------------------------------------------------------------===# + +# These tests trigger "not yet implemented" assertions in flang. +file(GLOB Unimplemented CONFIGURE_DEPENDS + # unimplemented: support for polymorphic types + poly_run_3.f90 + + # unimplemented: coarray allocation + allocate_errgmsg.f90 + get_array.f90 + lock_2.f90 + move_alloc_1.f90 + send_array.f90 + send_char_array_1.f90 + sendget_array.f90 + + # unimplemented: coarray reference + get_to_indirect_array.f90 + + # unimplemented: coarray in procedure interface + dummy_1.f90 + poly_run_1.f90 + pr107441-caf.f90 + ptr_comp_1.f08 + ptr_comp_2.f08 + scalar_alloc_1.f90 + + # unimplemented: intrinsic: '[SYM]' + coindexed_1.f90 + collectives_1.f90 + collectives_2.f90 + cosubscript_1.f90 + failed_images_2.f08 + image_status_2.f08 + stopped_images_2.f08 + this_image_1.f90 + + # unimplemented: EVENT POST runtime + event_4.f08 + + # unimplemented: LOCK runtime + lock_1.f90 + + # unimplemented: CriticalConstruct implementation + sync_1.f90 + sync_3.f90) + +# Some tests in the suite may be unsupported for one reason or another. +file(GLOB Skipped CONFIGURE_DEPENDS + # ------------------------------------------------------------------------ + # + # These tests are skipped because they hit a 'not yet implemented' assertion + # in flang. They should be removed from here when the corresponding feature + # is implemented. + + + # -------------------------------------------------------------------------- + # + # These tests are skipped because they trigger internal compiler errors. + # + + # error: Unexpected typeless constant value + alloc_comp_4.f90 + coarray_allocated.f90 + collectives_3.f90 + get_to_indexed_array_1.f90 + lib_realloc_1.f90 + pr93671.f90 + ptr_comp_3.f08 + scalar_alloc_2.f90 + + # error: not a constant derived type expression + alloc_comp_5.f90 + ptr_comp_4.f08 + + # error: No explicit type declared for '[SYM]' + image_index_1.f90 + image_index_2.f90 + image_index_3.f90 + this_image_2.f90 + + # -------------------------------------------------------------------------- + # + # These tests are skipped because they trigger semantic errors. It may be + # because they use non-standard features that are currently not supported, or + # it could be unimplemented features that are not tagged as such. + # + + # error: 'coarray=' argument must have corank > 0 for intrinsic '[SYM]' + alloc_comp_1.f90 + subobject_1.f90 + + # error: 'atom=' argument must be a scalar coarray or coindexed object for + # intrinsic '[SYM]' + atomic_1.f90 + + # error: '[SYM]' is not a known intrinsic procedure + atomic_2.f90 + collectives_4.f90 + + # error: Actual argument associated with coarray dummy argument must be + # a coarray + codimension.f90 + codimension_3.f90 + + # error: Coarray argument requires an explicit interface + event_1.f90 + event_3.f08 + + # error: Keyword 'stat=' may not appear in a reference to a procedure with an + # implicit interface + event_2.f90 + + # error: '[SYM]' is a non-ALLOCATABLE coarray and must have an explicit + # coshape + poly_run_2.f90 +) + +# These tests fail at runtime when they should pass. +file(GLOB Failing CONFIGURE_DEPENDS + fail_image_2.f08 +) + +list(APPEND UnsupportedTests "") +list(APPEND UnimplementedTests "${Unimplemented}") +list(APPEND SkippedTests "${Skipped}") +list(APPEND FailingTests "${Failing}") + +add_tests("${UnsupportedTests}" "${UnimplementedTests}" "${SkippedTests}" "${FailingTests}") diff --git a/Fortran/gfortran/regression/debug/CMakeLists.txt b/Fortran/gfortran/regression/debug/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/Fortran/gfortran/regression/debug/CMakeLists.txt @@ -0,0 +1,10 @@ +#===------------------------------------------------------------------------===# +# +# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +# See https://llvm.org/LICENSE.txt for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +# +#===------------------------------------------------------------------------===# + +# There are currently no tests in this directory to be disabled for any reason. +add_tests("" "" "" "") diff --git a/Fortran/gfortran/regression/g77/CMakeLists.txt b/Fortran/gfortran/regression/g77/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/Fortran/gfortran/regression/g77/CMakeLists.txt @@ -0,0 +1,31 @@ +#===------------------------------------------------------------------------===# +# +# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +# See https://llvm.org/LICENSE.txt for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +# +#===------------------------------------------------------------------------===# + +# These tests use (currently) unsupported GNU extensions. +file(GLOB Unsupported CONFIGURE_DEPENDS + intrinsic-unix-bessel.f # bes(j|y)(0|1|n), + intrinsic-unix-erf.f # derf +) + +# These tests are skipped because they cause flang to crash +file(GLOB Skipped CONFIGURE_DEPENDS + # error: 64-bit code requested on a subtarget that doesn't support it! + 20010216-1.f +) + +# These tests fail at runtime. +file(GLOB Failing CONFIGURE_DEPENDS + complex_1.f +) + +list(APPEND UnsupportedTests "${Unsupported}") +list(APPEND UnimplementedTests "") +list(APPEND SkippedTests "${Skipped}") +list(APPEND FailingTests "${Failing}") + +add_tests("${UnsupportedTests}" "${UnimplementedTests}" "${SkippedTests}" "${FailingTests}") diff --git a/Fortran/gfortran/regression/goacc-gomp/CMakeLists.txt b/Fortran/gfortran/regression/goacc-gomp/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/Fortran/gfortran/regression/goacc-gomp/CMakeLists.txt @@ -0,0 +1,10 @@ +#===------------------------------------------------------------------------===# +# +# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +# See https://llvm.org/LICENSE.txt for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +# +#===------------------------------------------------------------------------===# + +# There are currently no tests in this directory to be disabled for any reason. +add_tests("" "" "" "") diff --git a/Fortran/gfortran/regression/goacc/CMakeLists.txt b/Fortran/gfortran/regression/goacc/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/Fortran/gfortran/regression/goacc/CMakeLists.txt @@ -0,0 +1,10 @@ +#===------------------------------------------------------------------------===# +# +# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +# See https://llvm.org/LICENSE.txt for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +# +#===------------------------------------------------------------------------===# + +# There are currently no tests in this directory to be disabled for any reason. +add_tests("" "" "" "") diff --git a/Fortran/gfortran/regression/gomp/CMakeLists.txt b/Fortran/gfortran/regression/gomp/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/Fortran/gfortran/regression/gomp/CMakeLists.txt @@ -0,0 +1,12 @@ +#===------------------------------------------------------------------------===# +# +# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +# See https://llvm.org/LICENSE.txt for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +# +#===------------------------------------------------------------------------===# + +# There are currently no tests in this directory to be disabled for any reason. +add_tests("" "" "" "") + +add_subdirectory(appendix-a) diff --git a/Fortran/gfortran/regression/gomp/appendix-a/CMakeLists.txt b/Fortran/gfortran/regression/gomp/appendix-a/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/Fortran/gfortran/regression/gomp/appendix-a/CMakeLists.txt @@ -0,0 +1,10 @@ +#===------------------------------------------------------------------------===# +# +# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +# See https://llvm.org/LICENSE.txt for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +# +#===------------------------------------------------------------------------===# + +# There are currently no tests in this directory to be disabled for any reason. +add_tests("" "" "" "") diff --git a/Fortran/gfortran/regression/graphite/CMakeLists.txt b/Fortran/gfortran/regression/graphite/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/Fortran/gfortran/regression/graphite/CMakeLists.txt @@ -0,0 +1,10 @@ +#===------------------------------------------------------------------------===# +# +# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +# See https://llvm.org/LICENSE.txt for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +# +#===------------------------------------------------------------------------===# + +# The tests in this directory exercise the graphite polyhedral compiler that is +# part of the GNU compiler collection. This is not relevant for flang. diff --git a/Fortran/gfortran/regression/guality/CMakeLists.txt b/Fortran/gfortran/regression/guality/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/Fortran/gfortran/regression/guality/CMakeLists.txt @@ -0,0 +1,10 @@ +#===------------------------------------------------------------------------===# +# +# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +# See https://llvm.org/LICENSE.txt for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +# +#===------------------------------------------------------------------------===# + +# The tests in this directory seem to check the interaction of the compiler with +# gdb. It is not clear how we can test that - or if we even want to. diff --git a/Fortran/gfortran/regression/ieee/CMakeLists.txt b/Fortran/gfortran/regression/ieee/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/Fortran/gfortran/regression/ieee/CMakeLists.txt @@ -0,0 +1,79 @@ +#===------------------------------------------------------------------------===# +# +# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +# See https://llvm.org/LICENSE.txt for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +# +#===------------------------------------------------------------------------===# + +# These tests are disabled because they use unsupported extensions. +file(GLOB Unsupported CONFIGURE_DEPENDS + dec_math_1.f90 # cotand, cotan +) + +# These tests are disabled because they trigger "not yet implemented" +# assertions in flang. +file(GLOB Unimplemented CONFIGURE_DEPENDS + # unimplemented: assumed rank in procedure interface + ieee_1.F90 + large_3.F90 + modes_1.f90 + + # unimplemented: intrinsic module procedure: [SYM] + fma_1.f90 + ieee_11.F90 + ieee_12.f90 + ieee_2.f90 + ieee_3.f90 + ieee_4.f90 + large_2.f90 + rounding_1.f90 + rounding_2.f90 + rounding_3.f90 + signaling_1.f90 + signaling_2.f90 + signaling_3.f90 + signbit_1.f90 + + # unimplemented: no math runtime available for 'sqrt(f80)' + large_1.f90 +) + +# These tests are disabled because they cause flang to crash. +file(GLOB Skipped CONFIGURE_DEPENDS + # error: No specific subroutine of generic '[SYM]' matches the actual + # arguments + ieee_6.f90 + + # error: missing mandatory 'p=' argument + ieee_7.f90 + + # error: Must be a constant value + ieee_8.f90 + + # error: No specific subroutine of generic '[SYM]' matches the actual + # arguments + ieee_6.f90 + + # error: missing mandatory 'p=' argument + ieee_7.f90 + + # error: Must be a constant value + ieee_8.f90 + + # error: unexpected typeless constant value + ieee_10.f90 + ieee_5.f90 + ieee_9.f90 + intrinsics_1.f90 + intrinsics_2.F90 + large_4.f90 + underflow_1.f90 +) + +list(APPEND UnsupportedTests "${Unsupported}") +list(APPEND UnimplementedTests "${Unimplemented}") +list(APPEND SkippedTests "${Skipped}") +list(APPEND FailingTests "") + +add_tests("${UnsupportedTests}" "${UnimplementedTests}" "${SkippedTests}" "${FailingTests}") diff --git a/Fortran/gfortran/regression/lit.local.cfg b/Fortran/gfortran/regression/lit.local.cfg new file mode 100644 --- /dev/null +++ b/Fortran/gfortran/regression/lit.local.cfg @@ -0,0 +1 @@ +config.traditional_output = False diff --git a/Fortran/gfortran/regression/lto/CMakeLists.txt b/Fortran/gfortran/regression/lto/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/Fortran/gfortran/regression/lto/CMakeLists.txt @@ -0,0 +1,48 @@ +#===------------------------------------------------------------------------===# +# +# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +# See https://llvm.org/LICENSE.txt for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +# +#===------------------------------------------------------------------------===# + +# These tests are disabled because they trigger a "not yet implemented" +# assertion in flang. +file(GLOB Unimplemented CONFIGURE_DEPENDS + # unimplemented: BIND(C) module variable linkage + bind_c-1_0.f90 + bind_c-2_0.f90 + bind_c-2b_0.f90 + bind_c-3_0.f90 + bind_c-4_0.f90 + bind_c-5_0.f90 + bind_c-6_0.f90 +) + +# These tests are disabled because they cause flang to crash +file(GLOB Skipped CONFIGURE_DEPENDS + # error: Unexpected typeless constant value + 20100222-1_0.f03 + + # -------------------------------------------------------------------------- + # + # These tests are skipped because of "odd" reasons. + + # This test seems to depend on pr87689_1.f but that is not declared in the + # main file, pr87689_0.f. Because of the missing dependency, attempting to + # build it results in an undefined reference at link time. + pr87689_0.f + + # pr41576_1.f90 seems to be the main file, but there are no dg directives in + # it. Instead, there is a run directive in pr41576_0.f90 which consists of a + # single subroutine foo that is called in pr41576_1.f90. Obviously, the dg + # directive is in the wrong place and it ought to be fixed. + pr41576_0.f90 +) + +list(APPEND UnsupportedTests "") +list(APPEND UnimplementedTests "${Unimplemented}") +list(APPEND SkippedTests "${Skipped}") +list(APPEND FailingTests "") + +add_tests("${UnsupportedTests}" "${UnimplementedTests}" "${SkippedTests}" "${FailingTests}") diff --git a/Fortran/gfortran/regression/prof/CMakeLists.txt b/Fortran/gfortran/regression/prof/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/Fortran/gfortran/regression/prof/CMakeLists.txt @@ -0,0 +1,10 @@ +#===------------------------------------------------------------------------===# +# +# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +# See https://llvm.org/LICENSE.txt for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +# +#===------------------------------------------------------------------------===# + +# The tests in this directory seem to check profiling. For now, there is nothing +# useful that we can do with it. diff --git a/Fortran/gfortran/regression/ubsan/CMakeLists.txt b/Fortran/gfortran/regression/ubsan/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/Fortran/gfortran/regression/ubsan/CMakeLists.txt @@ -0,0 +1,10 @@ +#===------------------------------------------------------------------------===# +# +# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +# See https://llvm.org/LICENSE.txt for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +# +#===------------------------------------------------------------------------===# + +# There are currently no tests in this directory to be disabled for any reason. +add_tests("" "" "" "") diff --git a/Fortran/gfortran/regression/vect/CMakeLists.txt b/Fortran/gfortran/regression/vect/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/Fortran/gfortran/regression/vect/CMakeLists.txt @@ -0,0 +1,19 @@ +#===------------------------------------------------------------------------===# +# +# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +# See https://llvm.org/LICENSE.txt for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +# +#===------------------------------------------------------------------------===# + +# These tests fail at runtime. +file(GLOB Failing CONFIGURE_DEPENDS + pr60510.f +) + +list(APPEND UnsupportedTests "") +list(APPEND UnimplementedTests "") +list(APPEND SkippedTests "") +list(APPEND FailingTests "${Failing}") + +add_tests("${UnsupportedTests}" "${UnimplementedTests}" "${SkippedTests}" "${FailingTests}") diff --git a/Fortran/gfortran/torture/CMakeLists.txt b/Fortran/gfortran/torture/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/Fortran/gfortran/torture/CMakeLists.txt @@ -0,0 +1,12 @@ +#===------------------------------------------------------------------------===# +# +# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +# See https://llvm.org/LICENSE.txt for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +# +#===------------------------------------------------------------------------===# + +add_subdirectory(compile) +add_subdirectory(execute) + +file(COPY lit.local.cfg DESTINATION "${CMAKE_CURRENT_BINARY_DIR}") diff --git a/Fortran/gfortran/torture/compile/CMakeLists.txt b/Fortran/gfortran/torture/compile/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/Fortran/gfortran/torture/compile/CMakeLists.txt @@ -0,0 +1,11 @@ +#===------------------------------------------------------------------------===# +# +# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +# See https://llvm.org/LICENSE.txt for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +# +#===------------------------------------------------------------------------===# + +# It is not clear how we can use the compile tests within the test suite. It +# would be good to modify the test suite to be able to use it somehow, but for +# now, there is nothing we can do. diff --git a/Fortran/gfortran/torture/execute/CMakeLists.txt b/Fortran/gfortran/torture/execute/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/Fortran/gfortran/torture/execute/CMakeLists.txt @@ -0,0 +1,126 @@ +#===------------------------------------------------------------------------===# +# +# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +# See https://llvm.org/LICENSE.txt for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +# +#===------------------------------------------------------------------------===# + +# Creates a test from each valid test file in the current source directory. Each +# argument to a function is a list. If a test file is in any of the lists, a +# test will not be created from it. +function(add_tests UnsupportedTests UnimplementedTests SkippedTests FailingTests) + # All the tests here are single-source. + file(GLOB AllFiles CONFIGURE_DEPENDS LIST_DIRECTORIES false + *.f* + *.F* + ) + + set(TestsToSkip) + + # There is still a chance that some of the unsupported tests may need to be + # enabled, for instance if the non-standard extensions that they exercise are + # supported due to user demand. + if (NOT TEST_SUITE_FORTRAN_FORCE_ALL_TESTS AND + NOT TEST_SUITE_FORTRAN_FORCE_UNSUPPORTED_TESTS) + list(APPEND TestsToSkip ${UnsupportedTests}) + endif() + + # For the remaining tests, there is cause to build and run the skipped, failing + # and unimplemented tests since some could be enabled once some feature is + # implemented. Eventually, all the TEST_SUITE_FORTRAN_FORCE_* options (perhaps + # with the exception of TEST_SUITE_FORTRAN_FORCE_UNSUPPORTED_TESTS) should + # become redundant and removed. + if (NOT TEST_SUITE_FORTRAN_FORCE_ALL_TESTS AND + NOT TEST_SUITE_FORTRAN_FORCE_UNIMPLEMENTED_TESTS) + list(APPEND TestsToSkip ${UnimplementedTests}) + endif() + + if (NOT TEST_SUITE_FORTRAN_FORCE_ALL_TESTS AND + NOT TEST_SUITE_FORTRAN_FORCE_FAILING_TESTS) + list(APPEND TestsToSkip ${FailingTests}) + endif() + + if (NOT TEST_SUITE_FORTRAN_FORCE_ALL_TESTS AND + NOT TEST_SUITE_FORTRAN_FORCE_SKIPPED_TESTS) + list(APPEND TestsToSkip ${SkippedTests}) + endif() + + foreach(TestToSkip ${TestsToSkip}) + list(REMOVE_ITEM AllFiles ${TestToSkip}) + endforeach() + + foreach(File ${AllFiles}) + gfortran_execute_test(${File} + PREFIX "gfortran-torture-execute" + FFLAGS "" + LDFLAGS "" + DEPFILES "") + endforeach() +endfunction() + +# These tests are disabled because they cause internal compiler errors. +file(GLOB Skipped CONFIGURE_DEPENDS + # error: not a constant derived type expression + der_init_2.f90 + der_init_3.f90 + der_init_4.f90 + der_init_5.f90 + der_type.f90 + + # error: unexpected typeless constant value + data.f90 + data_2.f90 + dep_fails.f90 + der_init.f90 + der_io.f90 + der_point.f90 + entry_8.f90 + equiv_3.f90 + forall_3.f90 + forall_5.f90 + forall_6.f90 + intrinsic_associated.f90 + intrinsic_len.f90 + iolength_2.f90 + pr32604.f90 + st_function.f90 + where_7.f90 + where_8.f90 + + # error: failed to legalize operation 'math.ctlz' that was explicitly marked + # illegal + intrinsic_leadz.f90 + + # -------------------------------------------------------------------------- + # + # These tests are skipped because they trigger semantic errors. It may be + # because they use non-standard features that are currently not supported, or + # it could be unimplemented features that are not tagged as such. + # + + # error: Result of ENTRY is not compatible with result of containing function + entry_2.f90 + + # error: '[SYM]' is not a known intrinsic procedure + specifics.f90 +) + +# These tests are disabled because they fail at runtime when they should pass. +file(GLOB Failing CONFIGURE_DEPENDS + data_3.f90 + elemental.f90 + forall_7.f90 + intrinsic_fraction_exponent.f90 + intrinsic_nearest.f90 + intrinsic_sr_kind.f90 + nan_inf_fmt.f90 + random_2.f90 +) + +list(APPEND UnsupportedTests "") +list(APPEND UnimplementedTests "") +list(APPEND SkippedTests "${Skipped}") +list(APPEND FailingTests "${Failing}") + +add_tests("${UnsupportedTests}" "${UnimplementedTests}" "${SkippedTests}" "${FailingTests}") diff --git a/Fortran/gfortran/torture/lit.local.cfg b/Fortran/gfortran/torture/lit.local.cfg new file mode 100644 --- /dev/null +++ b/Fortran/gfortran/torture/lit.local.cfg @@ -0,0 +1 @@ +config.traditional_output = False diff --git a/LICENSE.TXT b/LICENSE.TXT --- a/LICENSE.TXT +++ b/LICENSE.TXT @@ -306,6 +306,8 @@ Rodinia: llvm-test/MultiSource/Benchmarks/Rodinia Rodinia: llvm-test/MultiSource/Benchmarks/Rodinia gcc-c-torture: llvm-test/SingleSource/Regression/C/gcc-c-torture/execute +gfortran llvm-test/Fortran/gfortran/regression + llvm-test/Fortran/gfortran/torture ============================================================================== Legacy LLVM License (ttps://llvm.org/docs/DeveloperPolicy.html#legacy): diff --git a/cmake/modules/SingleMultiSource.cmake b/cmake/modules/SingleMultiSource.cmake --- a/cmake/modules/SingleMultiSource.cmake +++ b/cmake/modules/SingleMultiSource.cmake @@ -33,7 +33,7 @@ if(DEFINED Source) set(sources ${Source}) else() - file(GLOB sources *.c *.cpp *.cc *.f *.F *.f90 *.F90) + file(GLOB sources *.c *.cpp *.cc *.f *.F *.f90 *.F90 *.f03 *.F03 *.f08 *.F08) endif() foreach(source ${sources}) basename(name ${source}) @@ -51,7 +51,7 @@ function(llvm_multisource target) set(sources ${ARGN}) if(NOT sources) - file(GLOB sources *.c *.cpp *.cc *.f *.F *.f90 *.F90) + file(GLOB sources *.c *.cpp *.cc *.f *.F *.f90 *.F90 *.f03 *.F03 *.f08 *.F08) endif() llvm_test_executable_no_test(${target} ${sources}) diff --git a/cmake/modules/TestSuite.cmake b/cmake/modules/TestSuite.cmake --- a/cmake/modules/TestSuite.cmake +++ b/cmake/modules/TestSuite.cmake @@ -49,6 +49,7 @@ append_target_flags(COMPILE_FLAGS ${target} ${CFLAGS}) append_target_flags(COMPILE_FLAGS ${target} ${CPPFLAGS}) append_target_flags(COMPILE_FLAGS ${target} ${CXXFLAGS}) + append_target_flags(COMPILE_FLAGS ${target} ${FFLAGS}) # Note that we cannot use target_link_libraries() here because that one # only interprets inputs starting with '-' as flags. append_target_flags(LINK_LIBRARIES ${target} ${LDFLAGS}) @@ -70,9 +71,9 @@ endfunction() # Creates a new executable build target. Use this instead of `add_executable`. -# It applies CFLAGS, CPPFLAGS, CXXFLAGS and LDFLAGS. Creates a .test file if -# necessary, registers the target with the TEST_SUITE_TARGETS list and makes -# sure we build the required dependencies for compiletime measurements +# It applies CFLAGS, CPPFLAGS, CXXFLAGS, FFLAGS and LDFLAGS. Creates a .test +# file if necessary, registers the target with the TEST_SUITE_TARGETS list and +# makes sure we build the required dependencies for compiletime measurements # and support the TEST_SUITE_PROFILE_USE mode. function(llvm_test_executable target) llvm_test_executable_no_test(${target} ${ARGN}) @@ -89,6 +90,7 @@ append_target_flags(COMPILE_FLAGS ${target} ${CFLAGS}) append_target_flags(COMPILE_FLAGS ${target} ${CPPFLAGS}) append_target_flags(COMPILE_FLAGS ${target} ${CXXFLAGS}) + append_target_flags(COMPILE_FLAGS ${target} ${FFLAGS}) # Note that we cannot use target_link_libraries() here because that one # only interprets inputs starting with '-' as flags. append_target_flags(LINK_LIBRARIES ${target} ${LDFLAGS})